CST2641 Advanced
Java I
Lab Week 1
Exercises |
Exercise 3.1 Vol I
Using The resulting class file should be an application, NOT an applet. Inputs should be entered through a dialog box. Output results are printed directly to the console. Input and output should be of precision 2.
|
Exercise 3.2 Vol I Do the same exercise as above, but without the use of the input dialog box. Instead use input arguments. |
Exercise 4.1 Vol I In chapter 7 of Java for Students, there is a dice throwing program. Convert the applet to a stand alone program. Chapter 18 in Java for Students describes how to do the conversion from applets to stand alone programs. Use two text fields with appropriate labels to display the dice digits. Also make a separate Die.class that simulates the roll of the die. Each dice should be an object of the class Die. Here is the original program which is an applet that
will run in a browser: Here is the finished result. This is a
standalone program (cannot be run in a browser). |