Question 2: Grade Calculator (Use switch and f Write a program that takes a student's score...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Question 2: Grade Calculator (Use "switch" and "f Write a program that takes a student's score (out of 100) as input and prints out their corresponding grade according to the following scale (use "switch" for this calculation): 90-100: A 80-89: B 70-79: C 60-69: D Below 60: F Please validate the input (use "if" and "if... else" for validation). The input can be between 0 to 100 inclusive. Integer or real number is allowed, le. the user can enter 89 or 89.5, . If the input is below 0, display "The score has to be zero or above. Please try again.". And wait for another input. • If the input is above 100, display "The score has to be below 100. Please try again.". And wait for another input. . If the second time input is still invalid, display "It is still an invalid input. Bye!". And the program stops (use System.exit(1), please consult the online JDK API for its meaning). 4 The output is shown as following Figure 6: a normal input between 0 to 100 ****** Welcome to Grade Calculator **** **** Enter the student's score (out of 100): 90 The student's grade is: A Figure 7: first input below 0. second input is between 0 to 100 Welcome to Grade Calculator. **** **** Enter the student's score (out of 100): -10 The score has to be zero or above. Please try again. 80 The student's grade is: B Question 2: Grade Calculator (Use "switch" and "f Write a program that takes a student's score (out of 100) as input and prints out their corresponding grade according to the following scale (use "switch" for this calculation): 90-100: A 80-89: B 70-79: C 60-69: D Below 60: F Please validate the input (use "if" and "if... else" for validation). The input can be between 0 to 100 inclusive. Integer or real number is allowed, le. the user can enter 89 or 89.5, . If the input is below 0, display "The score has to be zero or above. Please try again.". And wait for another input. • If the input is above 100, display "The score has to be below 100. Please try again.". And wait for another input. . If the second time input is still invalid, display "It is still an invalid input. Bye!". And the program stops (use System.exit(1), please consult the online JDK API for its meaning). 4 The output is shown as following Figure 6: a normal input between 0 to 100 ****** Welcome to Grade Calculator **** **** Enter the student's score (out of 100): 90 The student's grade is: A Figure 7: first input below 0. second input is between 0 to 100 Welcome to Grade Calculator. **** **** Enter the student's score (out of 100): -10 The score has to be zero or above. Please try again. 80 The student's grade is: B
Expert Answer:
Answer rating: 100% (QA)
Here is a Java program to calculate the grade of a student using switch and validate the input impor... View the full answer
Related Book For
Business Analytics Communicating With Numbers
ISBN: 9781260785005
1st Edition
Authors: Sanjiv Jaggia, Alison Kelly, Kevin Lertwachara, Leida Chen
Posted Date:
Students also viewed these programming questions
-
WHY IS CREDIT CALLED AS A PRODUCTIVE ASSET THAT MUST BE MANAGED WITH A BANK'S PROPERTIES?
-
Daphne bought a house ten years ago for $245,000.The real estate market has had it ups and downs since then. Daphne read a story in todays newspaper that says that during the past decade, houses in...
-
The following are trial balance of Clarissa Amanda Sdn. Bhd. as at 31st December 2021. Debit RM Credit RM Opening stock, 1 Jan 2021 16,000 Purchases 75,000 Sales return 5,000 Carriage inwards 1,500...
-
Find the point on the plane z = x + y + 1 closest to the point P = (1, 0, 0). Minimize the square of the distance.
-
In Niels Bohrs 1913 model of the hydrogen atom, an electron circles the proton at a distance of 5.29 x 10-11 m with a speed of 2.19 x 106 m/s. Compute the magnitude of the magnetic field that this...
-
Big-J Construction Company, Inc. (Big-J CC) is conducting routine periodic review of existing field equipment. The owner of Big-J CC has asked for a replacement evaluation of a paving machine now in...
-
Below is a list of transactions completed by Recycled Fashion during 2024. Ignore GST. For each transaction, indicate (a) the section (i.e. operating, investing or financing) of the statement of cash...
-
On December 31, 2012, the balances of the accounts appearing in the ledger of Warm Place Furnishings Company, a furniture wholesaler, are as follows.a. Prepare a multiple-step income statement for...
-
Masons Masons is a professional accounting and consultancy firm specialising in audit, tax and consultancy services, operating in three main offices located in Melbourne, Sydney and Auckland. Masons...
-
Jacqueline Ponce de Leon, a descendent of Juan Ponce de Leon, made a cash contribution of $1,500,000 to the City of Fountains to create and maintain a large fountain in front of City Hall in honor of...
-
Record and transcribe the exchanges between members of the group, team, or organization at one or more of its meetings. Use the following questions and illustrations to guide your work: a. Who opens...
-
SALEM Corporation Financial Analysis Background: SALEM Corporation is a manufacturing company that produces and sells electronic gadgets. The company has been in operation for the past five years and...
-
Art has played a significant role in every major civilization throughout history. When you think of art made hundreds or even thousands of years ago, what characteristics come to mind? What role do...
-
what ways do social institutions intersect with processes of social change and resistance, including the emergence of social movements and collective action aimed at challenging existing...
-
Compare the way public expectations control cast behavior, especially with respect to the most elite roles like Judy of the Jet with the role supervision and surveillance plays in controlling cast...
-
For years, guests have been confused with the difference between guaranteed and non-guaranteed reservations. Discuss how you will explain this to a guest to avoid any confusion as a reservation agent...
-
A copper pipe with a thermal conductivity of 400 W/mK is used to transfer heat from a hot fluid at 100C to a cold fluid at 20C. The copper pipe has a diameter of 0.2 m and a length of 1 m. How much...
-
The following processes constitute the air-standard Diesel cycle: 12: isentropic compression,23: constant-volume energy addition (T and P increase),34: constant-pressure energy addition (v...
-
Refer to the previous exercise for a description of the data set. Build a default regression tree to predict the customers annual household spending on travel products (TravelSpend). Display the...
-
A manager at a local grocery store learns that 75% of her customers will use a credit card when making a purchase. Use Excels Analysis ToolPak or R, both with a seed of 1, to simulate a sample of 12...
-
British biologist Ronald Fisher studied iris flowers and classified them according to the width and length of the flowers petals and sepals (a small, green leafy part below the petal). The...
-
Explain why only normal or zero economic profits are possible in a perfectly contestable market.
-
In what ways does the theory of contestable markets suggest that firm behaviour will be affected by the threat of entry into a market?
-
Are sunk costs, by definition, non-recoverable?
Study smarter with the SolutionInn App