Question: Project 7-2: Grade Converter Create an application that uses a class to convert number grades to letter grades and another class for data validation. Console

Project 7-2: Grade Converter

Create an application that uses a class to convert number grades to letter grades and another class for data validation.

Console

Welcome to the Letter Grade Converter

Enter numerical grade: 90

Letter grade: A

Continue? (y/n): y

Enter numerical grade: A

Error! Invalid integer. Try again.

Enter numerical grade: 87.9

Error! Invalid integer. Try again.

Enter numerical grade: 87

Letter grade: B

Continue? (y/n):

Error! This entry is required. Try again.

Continue? (y/n): OK

Error! Entry must be 'y' or 'n'. Try again.

Continue? (y/n): n

Specifications

The Grade class should have only one Instance Variable of type int.

Use a class named Grade to store the data for each grade. This class should include these three methods:

public void setNumber(int number)

public String getLetter()

The Grade class should have two constructors. The first one should accept no parameters and set the initial value of the number instance variable to zero. The second should accept an integer value and use it to set the initial value of the number instance variable.

The grading criteria are as follows:

A 88-100

B 80-87

C 67-79

D 60-67

F <60

Use the Console class presented in chapter 7 or an enhanced version of it to get and validate the users entries.

Overload the getString() method of the Console class to add the ability to require a string value, and to require one of two specified string values.

When the user responds to the Continue prompt, the application should only accept a value of y or n.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!