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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 21:30, moonk7733
The hybrid uses 144 to 158 volt batteries.
Answers: 1
image
Computers and Technology, 25.06.2019 09:30, Cxylaa
An output peripheral interacts with or sends data to the computer provides information to the user from the computer receives data from the computer and sends it to a modem stores data processed by the computer
Answers: 1
image
Computers and Technology, 25.06.2019 10:40, ooEVAoo
If you're using the paintbrush tool and want to change the color of the paint being used what should you change
Answers: 1
image
Computers and Technology, 25.06.2019 11:30, ciara180
What is a wiki farm? a.) a hosting service that allows you to build a wiki. b.) a collection of servers that store wiki search queries. c.) an association of wiki hosting companies. d.) a wiki created using environmentally friendly material.
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 in other subjects:

Konu
Mathematics, 23.01.2021 02:50
Konu
Business, 23.01.2021 02:50
Konu
Spanish, 23.01.2021 02:50