Question: Write a Java program that will prompt the user for the grades for an exam, computes the average, and returns the result. Your program must

 Write a Java program that will prompt the user for the grades for an exam, computes the average, and returns the result. Your program must be able to handle an unspecified number of grades. (Hint: Tell the user to enter -1 when they finished entering grades). Be sure to test your code with a variety of values and number of grades.

 

 

2. Write a Java program that will repeatedly display a menu of choices to a user and prompt them to enter an option. You should use the following options:

  • Say Hello - This should print "Hello" to console.
  • Addition - This should prompt the user to enter 2 numbers and return the sum of the two.
  • Multiplication - This should prompt the user to enter 2 numbers and return the product of the two.
  • Exit - Leave the program

The program should continue to return to the menu until the user enters 4.

 

Step by Step Solution

3.45 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 Heres a Java program that prompts the user for exam grades calculates the average and handles an unspecified number of grades by using 1 as the term... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!