Lab 3: (4 points)
Specifically one of each primitive data type will be seen in the console, and one of each will be seen in the Frame.
Copy the source onto your Unix account and compile the code there. Then on your web page give me a link to the source.
Lab 4: (4 points)
Create a GuessMyNumber java class in Eclipse and copy the code into it. There are a couple of errors in the program which you should be able to fix easily.
First, fix these errors and run the program to see how it works. (Basically it just prompts the user for a number.)
Then edit it to solve the following problem:
Format the number output so it is readable...from Course 1 Lesson 9:
NumberFormat nf = NumberFormat.getInstance();
nf.setMaximumFractionDigits(2);Lab 5: (4 points)
The provided code for this lab is here. Create a ComputeFigure java class in Eclipse and copy the code into it. Open the ComputeFigure.java class in the editor. Run the program (as Java Applet).
The Applet opens with a circle drawn
and allows you to draw either a circle (actually oval) or a rectangle by
Your task for this lab is to provide the following information for the geometric figure drawn (whether it be a circle or rectangle):
You may assume (for the ease of computation) that any oval drawn is really a circle.
Very Important:In the ComputeFigure.java file, there are three classes. You should NOT edit the MouseHandler or the ButtonHandler classes.
In fact, the only place you really need to edit is within the paint method of the ComputerFigure class.
Note that the code allows you to draw the rectangle and circle in the paint method - so the information/variables needed to calculate the required information is already there for you (x, y, width, height).
Finally, the information should be nicely formatted. For example output for the center point should be formatted as follows:
The center point is (45, 39) ... with, of course, the proper values for x and y
Again, format your output numbers so that they are readable (particularly the circle)
Finally, other than the paint method, do not worry about how the code works for now. We will discuss it in class.