Comp 110L
Lab Project #3
Due: 9/9/2009
1.
Write
a Java program to compute the average test score for the students in a
class. Assume that there are seven (7)
students who took the test and that the test scores are whole numbers between 0
and 100. Your program must read in the
seven scores, compute the average and print out the result.
2.
Write
a program that reads in the amount of a monthly mortgage payment and the
outstanding balance (i.e., the amount still owed) and then outputs the amount
of the payment that goes to interest and the amount that goes to principal
(i.e., the amount that goes to reducing the debt.) Assume that the annual interest rate is 5.49
percent. Use a defined constant for the
interest rate. Note that payments are
made monthly, so the interest is only one-twelfth of the annual interest of 5.49
percent.
3.
Write
a program that converts degrees Celsius to Fahrenheit (just a whole number) of
degrees, without a fractional part), and then let the program print out the equivalent Celsius temperature, including the fractional
part to at least one decimal point. A
possible dialog might be
Enter a temperature in
degrees Fahrenheit: 72
72 degrees
Fahrenheit = 22.2 degrees Celsius.
For
each of the above problems be sure to do the following:
1.
Plan
your solution by writing down the algorithm to solve the problem before you write the code.
2.
Make
sure your programs are self-documented including an appropriate comment header
block.
3.
Test
the programs by running at least three test cases on each.
For
each problem, turn in the algorithm design, a listing of the program, and a
listing of the output from running the test cases.