Part A) Create an applet that draws 4 java cups using a loop:
There should be at least 2 methods, the first should draw the cup using
variables in the arguments of the drawRect, drawOval, fillRect and fillOval
methods. The second method (paint) should the change the values of
the variables and use the first method to draw the series of cups. Parameter
passing is required.
Part B) Create an applet that draws a set of cups in the form of a cross using a loop and a selection statement :
Again there should be 2 methods, (Hint: use the cup drawing method
from part A). In the second method (paint), use a nested loop
(one to vary the x axis variable and one to vary the y axis variable) and
a selection statement ( to only use the first method when the x variable
is equal to a particular value OR the y variable is equal to a particular
value)
Create an HTML file named "assign3.html" and java source file named
"Assign3a.java" and "Assign3b.java" with the resulting class files being
"Assign3a.class" and "Assign3b.class respectively.