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, 20.06.2019 18:02
Internet protocol, domain name server, and internet file name make up a(n) blog online spreadsheet uniform resource locator (url) web browser
Answers: 3
question
Computers and Technology, 22.06.2019 18:30
Which of these options are the correct sequence of actions for content to be copied and pasted? select content, click the copy button, click the paste button, and move the insertion point to where the content needs to be inserted. click the copy button, select the content, move the insertion point to where the content needs to be inserted, and click the paste button. select the content, click the copy button, move the insertion point to where the content needs to be inserted, and click the paste button. select the content, move the insertion point to where the content needs to be inserted, click the copy button, and click the paste button.
Answers: 3
question
Computers and Technology, 22.06.2019 19:00
In he example code, what does the title attribute create? a tool tip an element a source a markup
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
What is html ? give a small description about html
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
Mathematics, 16.01.2021 03:10
question
Chemistry, 16.01.2021 03:10
question
Mathematics, 16.01.2021 03:10
question
Advanced Placement (AP), 16.01.2021 03:10
question
English, 16.01.2021 03:10
question
Mathematics, 16.01.2021 03:10
question
Mathematics, 16.01.2021 03:10
question
Social Studies, 16.01.2021 03:10
question
History, 16.01.2021 03:10
question
Advanced Placement (AP), 16.01.2021 03:10
Questions on the website: 13722361