QuestionQuestion

This lab requires writing 4 methods and the main program that calls all four methods. The methods should do the following:

1. Ask a user to enter 10 numbers and return the max of them.

2. Accept the number returned by the first method and round it down to the closest number divisible by 10. e.g., 37.6 is rounded to 30, -45 is rounded to -50, 10 is rounded to 10.

3. Accept the number returned by the second method and use switch statement to convert it to a letter "grade".
If the number is positive, then convert it to a letter grade as usual:
grade >= 90 is A; grade less than 60 is F, etc.
If the number is negative, then assign letter N.

4. Print the statement of the form:
The letter assigned to the number 84.6 when rounded to 80 is B.
In the previous example, 84.6 should be replaced by the number returned by the first method, 80 should be replaced by the number returned by the second method, and B should be replaced by the letter returned by the third method.

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

public class newLab {
    public static void main(String[] args) {
       double number = getMax();
       double round = roundIt(number);
       char letter = numberToLetter(round);
       System.out.println("The letter assigned to the number " + number + " when rounded to " + round + " is "+ letter +".\n" );
      
    }
   
    public static char numberToLetter(double num){
       if (num < 0) {
            return 'N';
       }...
$13.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats