Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Overview For this assignment, implement and use the methods for a class called S

ID: 3698365 • Letter: O

Question

Overview

For this assignment, implement and use the methods for a class called Student.

Student class

This class will represent a single student in the CSCI 240 class.

Data Members

The data members for the class are:

-a character array that holds a maximum of 50 characters and is used to hold the student's name

-an integer that holds the number of program points earned by the student

-an integer that holds the number of quiz points earned by the student

-an integer that holds the sum of the two lowest quiz scores earned by the student

-a double that holds the number of exam points earned by the student

-an integer symbolic constant that holds the maximum number of program points available in the course. Use a value of 905.

-an integer symbolic constant that holds the maximum number of quiz points available in the course. Use a value of 120.

-an integer symbolic constant that holds the maximum sum of the two lowest quiz scores. Use a value of 20.

-a double symbolic constant that holds the maximum number of exam points available in the course. Use a value of 300.

Constructor

This class has one constructor that should initialize the data member using the passed in arguments. It takes 5 arguments: a constant character array that holds the student's name, an integer that holds the number of program points the student has earned, an integer that holds the number of quiz points the student has earned, an integer that holds the sum of the student's two lowest quiz scores, and a double that holds the number of exam points that the student has earned.

The name data member should be initialized using the passed in argument and the strcpy function. The remaining numeric arguments should be initialized by calling the appropriate set access method and passing in the appropriate argument.

Methods

void setPgmPts( int newPgmPts )

This is a public method that makes a change to the data member that holds the number of program points that the student has earned. It takes 1 argument: an integer that holds a new number of program points. It returns nothing.

If the passed in argument is invalid (less than 0 or greater than the symbolic constant that holds the maximum number of program points), display an error message that the number of program points is invalid and set the data member that holds the number of program points to 0. If the passed in argument is valid, use it to set the data member that holds the number of program points.

void setQuizPts( int newQuizPts )

This is a public method that makes a change to the data member that holds the number of quiz points that the student has earned. It takes 1 argument: an integer that holds a new number of quiz points. It returns nothing.

If the passed in argument is invalid (less than 0 or greater than the symbolic constant that holds the maximum number of quiz points), display an error message that the number of quiz points is invalid and set the data member that holds the number of quiz points to 0. If the passed in argument is valid, use it to set the data member that holds the number of quiz points.

void setSum2Low( int newSum2Low )

This is a public method that makes a change to the data member that holds the sum of the two lowest quiz scores earned by the student. It takes 1 argument: an integer that holds a new sum of the two lowest quiz scores. It returns nothing.

If the passed in argument is invalid (less than 0 or greater than the symbolic constant that holds the maximum sum of the two lowest quiz scores), display an error message that the sum of the two lowest quiz scores is invalid and set the data member that holds the sum of the two lowest quiz scores to 0. If the passed in argument is valid, use it to set the data member that holds the sum of the two lowest quiz scores.

void setExamPts( double newExamPts )

This is a public method that makes a change to the data member that holds the number of exam points that the student has earned. It takes 1 argument: a double that holds a new number of exam points. It returns nothing.

If the passed in argument is invalid (less than 0 or greater than the symbolic constant that holds the maximum number of exam points), display an error message that the number of exam points is invalid and set the data member that holds the number of exam points to 0. If the passed in argument is valid, use it to set the data member that holds the number of exam points.

double calcPgmAverage()

This is a public method that returns the calculated program average for a student. It takes no argument. It returns a double, which is the calculated program average.

The program average is calculated by using the following formula:

Program Average = number of program points that the student has earned / the maximum number of program points available * 100

double calcExamAndQuizAverage()

This is a public method that returns the calculated exam and quiz average for a student. It takes no argument. It returns a double, which is the calculated exam and quiz average.

The exam and quiz average is calculated by using the following formula:

Exam and Quiz Average = ( number of exam points that the student has earned + number of quiz points that the student has earned - sum of the two lowest quiz scores that the student has earned) / ( the maximum number of exam points available + the maximum number of quiz points available - the maximum sum of the two lowest quiz scores ) * 100

double calcCourseAverage()

This is a public method that returns the calculated course average for a student. It takes no argument. It returns a double, which is the calculated course average.

The course average is calculated by using the following formula:

Course Average = 30% of the program average + 70% of the exam and quiz average

char letterGrade()

This is a public method that will determine the student's letter grade for the course. It takes no argument. It returns a character: the student's letter grade.

A student's letter grade is based on their course average. If the course average is greater than or equal to 90.00 and less than or equal to 100.00, then the student earned an A. If the course average is greater than or equal to 80.00 and less than 90.00, the student earned a B. If the course average is greater than or equal to 70.00 and less than 80.00, the student earned a C. If the course average is greater than or equal to 60.00 and less than 70.00, the student earned a D. If the course average is less than 60.00, the student earned a F.

There is one exception to the how the letter grade is determined and that's if the student didn't pass both portions of the course (ie. they didn't receive a program average greater than or equal to 55% or they didn't receive an exam and quiz average greater than or equal to 55%). If this is the case, then the student earned a F.

void printStudent()

This is a public method that will display the student's course information. It takes no argument. It returns nothing.

For the student, display the student's name, calculated program average, calculated exam and quiz average, course average, and letter grade. The averages should be formatted with exactly two digits after the decimal point. The format of the student's information, excluding the number of digits after the decimal point for the averages, is left up to you but it must be neat and easily readable.

main()

In main(), create 4 Student objects. They should contain the values:

The first Student object should be created using your name (John Smith), program points earned of 767, quiz points earned of 106, sum of the two lowest quizzes of 10, and exam points earned of 286.50.

The second Student object should be created using the name "Pat Jones", program points earned of 474, quiz points earned of 53, sum of the two lowest quizzes of 0, and exam points earned of 218.50.

The third Student object should be created using the name "Chris Wilson", program points earned of 905, quiz points earned of 120, sum of the two lowest quizzes of 20, and exam points earned of 300.

The fourth Student object should be created using any name you want (John Smith Jr.), an invalid number of program points earned, an invalid number of quiz points earned, an invalid sum of the two lowest quizzes, and an invalid number of exam points.

The rest of main() will include using the various methods on each of the Student objects. Display a label similar to "The first Student object" before anything is outputted for each of the objects.

For the first student, display their information.

For the second student, display their information.

For the third student, display their information.

For the fourth student, display their information, set the number of quiz points to 107, set the sum of the two lowest quizzes to 8, set the number of program points earned to 639, set the number of exam points earned to 211.50, and then display their information again.

Programming Notes

Each method must have a documentation box like a function.

Output

Remember that the names for the first and fourth student will be different in your output, but the averages and letter grades should be the same as below.

The error messages at the beginning of the output are caused by the creation of the fourth Student object. Where they show up in your output will depend upon how you choose to code main. The location (and order) of the messages does not matter, but your output MUST have all 4 at some point.

Extra Work:

add code that will allow the user to enter data from the keyboard and use the input data to build a fifth student object.

The user will be prompted to enter the first name, last name, program points earned, quiz points, sum of two lowest quiz scores, and exam score. Note that the constructor takes a student’s full name, so you must build the full name from the first name and the last name.

Output

Explanation / Answer

Hi I will answer this in next 4 hours. Working on this