
Concept explainers
Define a public Static method 'printGrade' with return type as 'void' in class 'ProblemSolution' and invoke it in the 'main' method. The 'printGrade' method will get the parameter 'score' with type double and
then print out the appropriate score char, e.g. 'A', 'B' or 'C' (Hint: use if-else).
When score >= 90.0 ---> print out 'A'
When 80.0 <= score < 90.0 ---> print out 'B'
When 70.0 <= score < 80.0 ---> print out 'C'
When 60.0 <= score < 70.0 ---> print out 'D'
When score is < 60.0 ---> print out 'F'
Then, inside the 'main' method.
The first line call the 'printGrade' method and put the parameter value 78.5.
The second line call the 'printGrade' method and put the parameter value 59.5.
Output
C
F
Where,
There should not be any space after the word.
![1 import java.util.*;
2
3 public class ProblemSolution {
4
5
//Define printGrade method here
6
7
8
//Main method
public static void main(String[] args) {
9
10
11 ▼
/* Invoke prinGrade here for value 78.5 here*/
12 v
/* Invoke prinGrade here for value 59.5 here*/
13
14
}
15 }](https://content.bartleby.com/qna-images/question/cab43375-9d8e-42d5-87b9-87b3ba8c37de/23e1b658-bab7-4ff4-bb10-6b919a901b39/yqfnin8_thumbnail.jpeg)

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

- You will build a program to manage a race car in this assessment. The code will consist of a for-loop method that will run a car around a race track and cause “wear and tear” on the car. The car will perform x number of laps and will have to make pitstops when it either runs out of gas or needs a tire replacement. The for loop will be simple def wear_tires(car): tire -=1 def use_gas(car): gas -=1 c = Car() # You need to make this part for i in range(100): if the car needs a pitstop: perform pitstop else: wear_tires(c) use_gas(c) # Display the current cars wear in a much better format print(c.tire) print(c.gas) print(“Current Lap is: “ , i) For this task, you will have to use this for loop and build out the two methods in the main Python program. To use the above code, you must build two pieces of information. An abstract Vehicle class A Car class A RaceCar class Each with its methods and variables. This programming will involve using inheritance and abstraction to make a race car…arrow_forwardJava Programarrow_forwardJava code using other methods within the main method.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





