subject

Create a java program that inputs a grade from the user. the grade input from the user will be an integer. once the input is stored, use an if-else-if block of code to determine the letter grade of the inputted integer grade. do not use a bunch of if statements by themselves to solve this problem. you will print an error message for inputs greater than 100 and for inputs less than 0. both errors must be handled together by a compound conditional statement that is joined by a short circuit and or or operator. assign your error message to a string variable and use that variable in a system. out. println statement to print the error. you must assign a char variable for each letter grade. use system. out. printf to print the letter grade. run your program several times using these inputs and ensure that you are receiving these outputs: input: 140 expected output: error - you have entered an invalid input. input: -45 expected output: error - you have entered an invalid input. input: 82 expected output: you have earned the letter grade b. run it a few more times using various other inputs. part ii convert the if-else-if code block to a switch statement to solve the problem. use modulus and/or integer division to convert the grade input so that the range of grades are converted to one value. all other requirements from part i are still required for part two. use the same inputs and the outputs should remain the same. my code import java. util. scanner; int grade; system. out. print("enter your grade: "); grade = scnr. nextint(); if (grade > = 90) { system. out. println("you have earned the letter grade a."); } else if (grade > = 80) { system. out. println("you have earned the letter grade b."); } else if (grade > = 70) { system. out. println("cyou have earned the letter grade c."); } else if (grade > = 60) { system. out. println("you have earned the letter grade d."); } else if (grade < = 59) { system. out. println("you have earned the letter grade f."); } else (0 > = grade > = 100) { system. out. println("you have entered an invalid input.") }

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
List the five on-board vehicle subsystems
Answers: 1
question
Computers and Technology, 23.06.2019 09:50
Allison and her group have completed the data entry for their spreadsheet project. they are in the process of formatting the data to make it easier to read and understand. the title is located in cell a5. the group has decided to merge cells a3: a7 to attempt to center the title over the data. after the merge, allison points out that it is not centered and looks bad. where would the title appear if allison unmerged the cells in an attempt to fix the title problem?
Answers: 2
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe and
Answers: 1
question
Computers and Technology, 24.06.2019 06:30
For which utilities, if any, does the landlord pay?
Answers: 2
You know the right answer?
Create a java program that inputs a grade from the user. the grade input from the user will be an in...
Questions
question
History, 14.12.2019 18:31
question
Mathematics, 14.12.2019 18:31
question
Mathematics, 14.12.2019 18:31
Questions on the website: 13722361