I need a program created with explanation of steps please!! In this program, you are to define and build a class, called Credit, which is used to store a single credit record. The class will be used in conjunction with a main program you write that is to read, sort (in reverse order), and print out a number of credit records. After sorting and printing the credit records, the program will also print out some simple statistics related to the data read. These include the maximum credit score read, the minimum score, and the average score. A generically-coded ascending-order sorting function is provided in the linked program fragment. Class Requirements The Credit class is to store the following information: Last name First name Income Credit score A static class variable storing the overall maximum credit score (among all class instances) A static class variable storing the overall minimum credit score (among all class instances) A static class variable storing the overall average credit score (among all class instances) The Credit class must have these member functions: a default constructor a function that compares the credit score of a particular instance with the score stored in the "max score" static class variable, and replaces that if the local value is greater. (Note that this function is not a static function. Although it deals with static data, it also deals with non-static data.) a function that compares the credit score of a particular instance with the score stored in the "min score" static class variable, and replaces that if the local value is less than or equal. This is also not a static function, for the same reasons as above. Static class functions that return the max and min score values stored in the respective static class variables. The credit records read are to be stored in an array of type Credit. The array should be large enough to handle up to 30 values. Overloading Requirements The program requires at least three overloaded operators. Since the data is to be sorted in reverse order, you must define operator< (or operator>) so that values in the Credit array can be compared and swapped accordingly. Use the credit score as a comparison key. In lieu of an input() type of member function, you are to overload the extraction operator>>. In lieu of an output() type of member function, you are to overload the insertion operator<<. Input Format The format of the data you enter is designed to make your input overload somewhat easier. Input format is shown in the following sample (which you can capture for use in your program): Last name First name Income Credit score for output: Each Creditinstance read (into the Credit array) must also call the member functions that determine the maximum and minimum so that those values can be established in the static class variables. When your program has finished sorting the array of Creditrecords, it should print the output of the static functions that display the maximum, minimum, and average scores. (How you determine the average is up to you, but it may or may not require the use of additional static class variables.)

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 7PE
icon
Related questions
Question

I need a program created with explanation of steps please!!

In this program, you are to define and build a class, called Credit, which is used to store a single credit record. The class will be used in conjunction with a main program you write that is to read, sort (in reverse order), and print out a number of credit records. After sorting and printing the credit records, the program will also print out some simple statistics related to the data read. These include the maximum credit score read, the minimum score, and the average score. A generically-coded ascending-order sorting function is provided in the linked program fragment.

Class Requirements

The Credit class is to store the following information:

  • Last name
  • First name
  • Income
  • Credit score
  • A static class variable storing the overall maximum credit score (among all class instances)
  • A static class variable storing the overall minimum credit score (among all class instances)
  • A static class variable storing the overall average credit score (among all class instances)

The Credit class must have these member functions:

  • a default constructor
  • a function that compares the credit score of a particular instance with the score stored in the "max score" static class variable, and replaces that if the local value is greater. (Note that this function is not a static function. Although it deals with static data, it also deals with non-static data.)
  • a function that compares the credit score of a particular instance with the score stored in the "min score" static class variable, and replaces that if the local value is less than or equal. This is also not a static function, for the same reasons as above.
  • Static class functions that return the max and min score values stored in the respective static class variables.

The credit records read are to be stored in an array of type Credit. The array should be large enough to handle up to 30 values.

Overloading Requirements

The program requires at least three overloaded operators.

  • Since the data is to be sorted in reverse order, you must define operator< (or operator>) so that values in the Credit array can be compared and swapped accordingly. Use the credit score as a comparison key.
  • In lieu of an input() type of member function, you are to overload the extraction operator>>.
  • In lieu of an output() type of member function, you are to overload the insertion operator<<.

Input Format

The format of the data you enter is designed to make your input overload somewhat easier. Input format is shown in the following sample (which you can capture for use in your program):

  • Last name
  • First name
  • Income
  • Credit score

for output:

Each Creditinstance read (into the Credit array) must also call the member functions that determine the maximum and minimum so that those values can be established in the static class variables. When your program has finished sorting the array of Creditrecords, it should print the output of the static functions that display the maximum, minimum, and average scores. (How you determine the average is up to you, but it may or may not require the use of additional static class variables.)

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT