Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java class, called LetterGradeConverter, encapsulating the concept of converting integer grades to letter grades (A, B, C, D, or F), assuming grades are

Write a Java class, called LetterGradeConverter, encapsulating the concept of converting integer grades to letter grades (A, B, C, D, or F), assuming grades are composed of a list of integers between 0 and 100. The LetterGradeConverter class has three instance variables: an array of integer grades called intGrades, a character array representing the letter grades called LettergradeList, and an integer variable for the actual size of the arrays called actialLength. The LetterGradeConverter class includes the following methods: ? A constructor having two parameters: the name of an input text file, which contains the integer grades of students, and the maximum size of grades list. The constructor would read the integer grades from the input file to initialize the intGrades array, then calls an internal method to convert the integer grades into letter grades. ? A private method, called LetterGradeConverter, which generates the list of letter grades from the list of integer grades. It determines the letter grade corresponding to each integer grade based on the following table: Letter Grade Integer Grade (M) A M ? 90 B 80 ? M < 90 C 70 ? M < 80 D 60 ? M < 70 F M < 60 ? toString() method that returns a nicely formatted string of the LetterGradeConvertor in the form of two-column table. The first column contains the integer grades and the second column contains the corresponding letter grades. ? equals() method that returns true if this LetterGradeConverter object is equal to the passed object. Two LetterGradeConverter objects are considered equal if their corresponding letter grades lists are the same. ? Accessor (i.e., getter) methods for the instance variables. (b) Write a client class, called LetterGradeDisplayer, to test all methods in your class. The client class should allow the user to enter the names of two input files that contain the integer grades of two classes to be converted to letter grades. The LetterGradeDisplayer compares between the two classes lists in terms of equality and displays their integer grades, and their letter grades.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago