Write a program that draws lines of random length in random colors, Eight concentric circles. The circles should be seprated by 10 pixels. Use the drawOval method of class Graphics. (File must be save as: Assignment10iii.java)

import java.awt.Graphics;
import java.awt.Color;
import java.applet.Applet;
import java.util.Random;

public class Assignment10iii extends Applet
{
            public void paint(Graphics gr)
            {
                        int i,len,r,g,b;
                        Random ran=new Random();
                        Color c;

                        for (i=10; i<=100; i+=10)
                        {
                                    len=ran.nextInt();
                                    if (len<0)
                                    len=-len;
                                    len=len%200;
                                    c=new Color(len,(len+150)%256,(len+90)%256);
                                    gr.setColor(c);
                                    gr.drawLine(50,i,50+len,i);
                        }
            }
}

 ////////////////////////////////////////////
Copy & paste this code in your Textpad & run, then you will get output.......
If you have any problem please comment below.........