Grade Calculator           

Description

This program requires the user to input 4 assignment scores and computes an  average score.

Instructions

For this quiz, you may not get assistance from your fellow students or from the TAs. The quiz is closed books, closed notes - but you can use any of the features in Eclipse.

  1. Add you name to the top of this paper.  You MUST turn in the paper at the end of the quiz to get credit.
  2. Create a new workspace called quizspace and have the TA check it.
  3. Bring up a browser and log into the checkin page. Raise your hand if you cannot see Q0 on the page.
  4. Create a Q0 project in Eclipse then write a class Q0 with a main method, and put all of the following code into the main method:
    1. Declare and initialize the following variables of type double:
      • assign0, assign1, assign2, assign3
      • assignAverage
    2. Instantiate (create) a Scanner object to read from the keyboard.
    3. Use System.out.print to display the prompt "First assignment: ".
    4. Use the Scanner to read a double value from the user into assign0.
    5. Repeat for the second, third, and fourth assignments, adjusting the prompts.
    6. Compute the average assignment score and assign to assignAverage.
    7. Print the assignment average, as shown in the output below (must have end of line).
    8. All output should have exactly 2 digits after the decimal point.
      • (HINT: use System.out.printf – see reverse side)
    9. Do not hard code any values, we will use different input values than those shown.

5.     Submit your program to the Checkin tab on the course website.

Sample output

Your program's output should match the example shown below, user input is shown in blue:

 
  First assignment: 11
  Second assignment: 22
  Third assignment: 33
  Fourth assignment: 44
  Assignment average: 27.50

Grading Criteria