Create a Java applet program with statements so that it willdisplay a 10 x 10 \"
ID: 3614410 • Letter: C
Question
Create a Java applet program with statements so that it willdisplay a 10 x 10 "checkerboard" filled with random colors. You mayuse the following pseudocode to help you:loop x from 0 to 450 incrementing by 50 each time
loop y from 0 to 450 incrementing by 50 each time
set red to a random number between 0 and 255inclusive
set green to a random number between 0 and 255inclusive
set blue to a random number between 0 and 255inclusive
set the drawing color to (red, green, blue)
fill a rectangle with top left corner at (x,y) usingwidth of 50 and height of 50
end loop y
end loop x
import javax.swing.JApplet;
import java.awt.*;
public class Small extends JApplet {
public void paint (Graphics g) {
?????????????????
} // end paint
} // end class
Please help me!!!
Explanation / Answer
please rate - thanks import javax.swing.JApplet; import java.awt.*; import java.util.Random; public class checkerboard1 extends JApplet { public void paint(Graphics g) {int j,k,num1,num2,num3; Random random = newRandom(); for(j=0;jRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.