Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question: Explain What The Program Does And Guide The User With Care, Giving Lots Of Instructions And Feedback. Label User Errors Explain what the program

Question:Explain What The Program Does And Guide The User With Care, Giving Lots Of Instructions And Feedback. Label User Errors

  • Explain what the program does and guide the user with care, giving lots of instructions and feedback.
  • Label user errors properly and understandably.
  • Be sure to format your output nicely so the computing process and the results are understandable.
  • need to use the specific exception that code throws
  1. Make a program that reads a grade percentage as an integer number from the user in the main method.
  2. The program should then send the number to a static method called calculateGrade which will calculate a letter grade from this number and print it out. The header for this method should look like this: public static void calculateGrade(int numIn) {
  • Use the table below for the number to grade conversion in your method
  • Number to Grade conversion table
    • From 0 to 59 grade is F
    • From 60 to 69 grade is D
    • From 70 to 79 grade is C
    • From 80 to 89 grade is B
    • From 90 to 100 grade is A

3. The method should print out a nice message telling the user the letter grade.

  • Your program must validate the user's input
    • You must check it to make sure it is a number and is within the range of allowed percentage values. I suggest you check for a number in the main, and for the range in the calculateGrade method.
  • Use try/catch and if/else statements to do this program.
    • First check to see that the user has entered a valid integer number.
      • If the input is not an integer number, the program should print a message telling the user the error and then exit. It should not call the calculateGrade method!
    • Also check that the number is not less than 0 or greater than 100.
      • If number is not in that range , the program should print a message telling the user the error and then exit. This can be done as part of the grade calculations in the calculateGrade method.
  • The program should not crash at any point no matter what the user enters.
    • I will try to crash it and points will be deducted if I can.
    • Make sure to test "edge conditions" for correctness:
      • If input is 0
      • If input is
      • if input is 100
      • if input is > 100
      • if input is 50, 60, 70, 80, or 90
      • if input is not a number
      • if input has a decimal

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

App Inventor

Authors: David Wolber, Hal Abelson

1st Edition

1449397484, 9781449397487

More Books

Students also viewed these Programming questions

Question

If P0 = 14 , P1 = 14 , P2 = 12 , then determine 0.

Answered: 1 week ago