Once this form has been customized for your institution, you can use this button to send your lab work. Be sure to read the instructions before starting your work.
To gain experience in
Write an applet that uses three Line2D.Double objects to draw a triangle, like this:
/* paste program here */
Anytine you write an applet, you need to provide both a Java program and an HTML file. What HTML file are you supplying to run this applet?
/* paste file here */
Use Rectangle2D.Double and Ellipse2D.Double objects to draw an automobile like this :
Generate five circles with radius 20, 40, 60, 80, and 100, all tangent at a common point, like this.
Draw each circle in a different color of your choice.
Write a program that 1) prompts for the user's name and 2) draws the name inside a rectangle.
Write a program that draws three lines, as in the following figure.
When the program starts, it should ask the user for a value v. Then it draws the line joining the origin (0,0) with the point (v, 200):
Line2D.Double line1 = new Line2D.Double(0, 0, v, 200);
Note that the equation of this line is
y = x * 200 / v
The second (horizontal) line has the equation
x = 100
You can obtain it as
Line2D.Double line2 = new Line2D.Double(100, 0, 100, getWidth());
The third (vertical) line has equation
y = 100
Finally, mark the intersection points with small circles and print their coordinate values. To compute the intersection points, you need to solve two sets of equations. This set gives you the first intersection point:
This set gives you the second intersection point:
Tip: Start with the Intersect.java program from the textbook. You need to change the equations, but the code for drawing and labeling the intersection points is helpful.
Run the program with a value of x = 160. What intersection points does your program produce?
Verify the computation by calculating the values by hand. Show your work here.
Given a coordinate system where the upper lefthand corner is (0,0) and the lower righthand corner is (3,3), write a graphics program to draw a stopsign like this:
Don't forget to send your answers when you're finished.