Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 1 Write a program in Java to read a value from the keyboard for score in a final exam. One can have a score
Question 1 Write a program in Java to read a value from the keyboard for score in a final exam. One can have a score of 10.5 as an example. Valid scores is in the range from 0 to 100. First show your high-level algorithm. Perhaps three statements that will be mapped to three methods shown below You should have the following four methods as shown below: 1.getDouble () method. - This method will accept a string to be displayed (the prompt) then read a double value then return to caller. 2. findGrade () method - This method will accept the score value then figure out the grade and return the correct grade to the caller of this method. 3.printinfo() method - A void method will accept two values - the score value and the grade. Secondly, refine your high-level algorithm above with the following details requirements transformed to statement of computation in your algorithm. You should have the following four methods as shown below: 1. getDouble () method. - This method will validate if the value entered is in the range from 0 to 100 . If yes, return that value otherwise return 1. 2. findGrade () method - This method will fiqure out the grade according to this table: You should use nested if-else here. 3.printinfo() method - Print score and grade with descriptive text. Notes : - the findGrade () method should only be called if score from the getDouble () method is valid. - Hence, if the score is valid, call the findGrade () method then followed by the printinfo () method. - Otherwise, display the invalid score entered with an appropriate description. - There will be no validation done in the findGrade () method as it will be redundant. Also use @param to describe the parameters and @return to describe what is returned. Must show output for two invalid scores of 110 and 4 Also valid scores for A,B,C,D and F. Hence, a total of 7 HOW to SUBMIT WORK? A Word file with a label heading for Question 1 at top followed by: a) Your high-level algorithm (2 points) b) Refinement of your algorithm. (3 points) c) Implementation in Java (22 points) d) Output showing 7 different inputs/outputs (screenshots) 3 points
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started