CIS 283 - Programing assignment10 Email: jperezc at calstatela.edu

This is similar to programming challenge 7, page 317 of our book

For this assignment you are going to write the code for the following class:

### Here are the specifications of class TestAverageAndGrade:

calcAverage
returns: the average of its five arguments as a double
arguments: five double numbers
what it does:

1. This method should accept five test scores as arguments and return the average of the scores.

Example:

System.out.println(taag.calcAverage(40,100,20,90,80));

would print 66.0

System.out.println(taag.calcAverage(40,40,40,40,40));

would print 40.0

returns: a char that can be either A, B, C, D, or F
arguments: one double
what it does: This method should accept a test score as an argument and return a

``` Score       Letter Grade

90–100      A
80–89       B
70–79       C
60–69       D
Below 60    F

otherwise   X```

Example:

would print X

would print A

would print F

• create a folder called Assignment10
• create a file called Square.java and save it in folder Assignment10
• compile all java files in folder Assignment10
• type the following command in the DOS prompt window:
• java Test10

• tests will be run on your code and appropriate messages will be printed out showing which tests passed and which failed. At the end the program will tell you which option to choose in the moodle quizz corresponding to programming exercise 10
• You must use Test10.print or Test10.println instead of System.out.print and System.out.println. Use Test10_java6.print and Tes10_java6.println if you are using java6.

You could use the following main method in order to test your program. You don't need to use it, you don't need to show it to me or submit it. Use it if you want to test your code:

``` public static void main(String[] args){
System.out.println(taag.calcAverage(40,100,20,90,80)); //66.0
System.out.println(taag.calcAverage(40,40,40,40,40)); //40.0```
```     System.out.println("score\tgrade");
for(int t = 0; t<=102;t++){
` } `
` `