We will do this lab in class on Tuesday September 2.
Lab2.java
in
your CS140
folder on your P: drive.
In the definitions pane
(that's the largest window in the DrJava editor) start a
skeleton class with the following:
public class Lab2 { public static void main(String[] args) { // put your code here } }
Write all of your Java in the main
method of the Lab2 class.
Keep adding to your program as you work on parts of the lab.
hwAvg
to hold
Poindexter's homework average. Write a Java expression to
caculate that average and assign it to the variable.
Let Java do all of the calculating, don't do any calculations in your
head or use a calculator. Java is the ultimate calculator.
Poindexter's homework average is 87.52%The actual average should be displayed where
87.52%
is
as a
number between zero and one hundred to two decimal places.
(I just made up the 87.52 and its not correct). Don't hardcode
the average in the print statement, use the value held in the variable
hwAvg
.
labAvg
. Print the variable to the console with
a nice message just like you did for the homework average.
examAvg
.
Again, let Java do all of the calculations.
Print examAvg
to the console to two decimal places with a nice message.
overallAvg
and print it to the console with a nice message. Again
let Java do all of the calculations.