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, 23.06.2019 01:30
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most? a)give the file a unique name b)name the file in yymmdd format c)use descriptive name while naming the files d)use capital letters while naming the file
Answers: 3
question
Computers and Technology, 23.06.2019 19:00
Acompany is hiring professionals for web designing. the firm is small with few resources. they want employees who possess problem-solving skills and can independently carry out responsibilities. which kind of employee should they select?
Answers: 2
question
Computers and Technology, 24.06.2019 23:00
Why is it preferable to code web pages in html format? a. to create more lines code b. to apply general formatting rules c. to display properly as search results in all browsers d. to add meaning to the document
Answers: 1
question
Computers and Technology, 25.06.2019 08:00
Aresearcher wants to do a web-based survey of college students to collect information about their sexual behavior and drug use. direct identifiers will not be collected; however, ip addresses may be present in the data set. risk of harm should be evaluated by: solely by the magnitude or severity of expected harm. both the magnitude (or severity) and the probability (or likelihood) of harm. solely by the probability of expected harm. neither the magnitude or probability of harm.
Answers: 3
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, 06.01.2021 17:20
question
Mathematics, 06.01.2021 17:20
question
English, 06.01.2021 17:20
question
Mathematics, 06.01.2021 17:20
question
Law, 06.01.2021 17:20
Questions on the website: 13722367