Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Tasks Create a new Project (Lab5). 1) Task: Practice with if statements (8 pts) a) Create a new package task1 and a new class in
Tasks Create a new Project (Lab5). 1) Task: Practice with if statements (8 pts) a) Create a new package "task1" and a new class in that package "GradeMaker". Add the empty "main" method in your class o main: In the "main" method, create a Scanner object to read user keyboard input. Prompt the user to enter a grade value between 0.0 and 100.0 If the grade entered is NOT between 0.0 and 100.0 print an error message and return from "main" -just use return; Call a method called "calcGrade" (we'll write that method shortly) and pass the score the user entered as the parameter. This method should return a string so be sure to save the returned value. Print the returned value as follows (showing an example grade value): Grade: A o calcGrade Create a method "calcGrade" that accepts one parameter a score value. Create a string variable to hold the letter grade, leave it unassigned for now. Create an it/else if...else statement to support the following letter grade scheme 90.0-100.0 A 80.0-90.0 (do not include the end-point value here) B .70.0-80.0 (do not include the end-point value here) C 60.0 70.0 (do not include the end-point value here)D Otherwise, the grade is F. Return the letter grade from your function
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started