Question: Test Average and Grade ( Methods Program ) : Write a program that asks the user to enter 5 test scores ( NO arrays! )
Test Average and Grade Methods Program: Write a program that asks the user to enter test scores NO arrays! Your program should then display a letter grade for each test score, the average test score and the overall letter grade for the average score.
Your program is required to have and use the following methods these methods CAN NOT be void methods for calculating the average score and giving the letter grade for EACH score including the average score:
calcAverage This method must accept test scores as arguments and must return the average of the scores NOT A VOID METHOD
determineGrade This method must accept a test score as an argument and must return a letter grade for the score it accepted as an argument NOT A VOID METHOD
Heres the grading scale:
Score
Letter Grade
A
B
C
D
Below
F
Conversion Program using Methods, pts: Write a program that converts meters to kilometers, inches, or feet depending on the users selection from a menu.
Your program is required to have the following methods:
convertKilometers This must be a method that accepts the number of meters as an argument and returns the number of kilometers NOT A VOID METHOD Convert meters to kilometers using the following formula:
kilometers meters
convertInches This must be a method that accepts the number of meters as an argument and returns the number of inches NOT A VOID METHOD Convert meters to inches using the following formula:
inches meters
convertFeet This must be a method that accepts the number of meters as an argument and returns the number of feet NOT A VOID METHOD Convert meters to feet using the following formula:
feet meters
showMenu this must be a void method that accepts no arguments this one is void It should display the following menu:
METER CONVERSION
Convert to Kilometers
Convert to Inches
Convert to Feet
Quit the Program
Please make a selection:
The program should run as follows:
The program should start in the main method by calling the showMenu method to display the menu. The program should then get the users selection use int
Once the program main method gets the users selection it should ask the user for a number of meters assume double Do input validation on the number of meters to prevent a negative number of meters. When valid, the number of meters the user enters will be passed as an argument into one of the methods depending on what the users selection was.
If the user chose the convertKilometers method should be called with the number of meters the user entered passed to it as an argument. The number of meters converted to kilometers should be returned to the main method.
If the user chose the convertInches method should be called with the number of meters the user entered passed to as an argument. The number of meters converted to inches should be returned to the main method.
If the user chose the convertFeet method should be called with the number of meters the user entered passed to it as an argument. The number of meters converted to kilometers should be returned to the main method.
Once the program main method receives the converted number of meters from the: convertKilometers, convertInches, or convertFeet method, it should display the results format with digits to the right of the decimal point
Example output:
meters is kilometers.
The program should continue to run until the user selects to quit the program. So the user should be able to make as many conversions as they would like print invalid selection if not from to
Input validation Again, do not allow the user to enter a negative number for the amount of meters.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
