subject

In this lab assignment, you will help Professor P to implement the Grade Curve Calculator, which allows Professor P to calculate the average score for Midterm Exam, and help her curve the scores based on the expected average. You need to provide the implementation of the class gradeList, which is declared in the gradeList. h, to complete the definition for this class. The program will first create one gradeList object, named CS215gradebook_original to store scores from the user input until the user enters "Q" or "q" to quit entering scores. The valid score should be in the range [0,100]. The program then displays the average score based on all the valid input scores from the user, and ask the user to type an expected average (Note that the expected average from user input should be great than the original average, and less than or equal to 100. If the expected average happens to be the same as the original average, then no curve is needed). If the user input a valid expected average, the program should add the extra score (which is the difference between the original average and the expected average) to every score stored in the original gradebook, however if a score reaches the maximum score, which is 100 points, the score will keep 100. For example, if the extra score is 5 points to be added to each student’s score, however, if one student’s original score was 98, after the grading curve, his/her score will be 100 instead of 103. Because of this possible truncation, the actual average may be less than or equal to the expected average, that is one reason that Professor P may try to type different "expected averages" to approach to the desired curve for the students.

#ifndef GRADELIST_H
#define GRADELIST_H

#include

using namespace std;
const int INITIAL_CAPACITY = 5;
const double MAX_SCORE = 100;
class gradeList
{
public:
// constructors and copy constructor
gradeList(); //create a list with capacity = INITIAL_CAPACITY
gradeList(int in_capacity); //create a list with in_capacity
gradeList(const gradeList &other); // copy constructor

// define the assignment operator
gradeList &operator=(const gradeList &other);

// destructor
~gradeList();

// return the size of the grade list
int getSize() const;

// insert a score into the tail of the grade list
void insert(double score);

// return the average score among all scores in the grade list
double getAverage() const;

// each score in the grade list will be increased by the given value
// If the score reaches MAX_SCORE, it does not go beyond
void incrementScore(double value);

// print the scores in the grade list
void print() const;

private:
int capacity; //the capacity of the grade list
int size; // the number of scores in the grade list
double* grade_ptr; // the pointer grade_ptr points at the first item in the grade list
};
#endif /* GRADELIST_H */

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:40
"it security policy enforcement and monitoring" respond to the following: describe how monitoring worker activities can increase the security within organizations. describe the rationale that managers should use to determine the degree of monitoring that the organization should conduct. explain the extent to which you believe an organization has the right to monitor user actions and traffic. determine the actions organizations can take to mitigate the potential issues associated with monitoring user actions and traffic.
Answers: 3
question
Computers and Technology, 23.06.2019 10:30
How would you categorize the software that runs on mobile devices? break down these apps into at least three basic categories and give an example of each.
Answers: 1
question
Computers and Technology, 24.06.2019 00:00
Afashion designer wants to increase awareness about her brand. which network can she use and why she can use the blank to blank her products online. answers for the first blank: internet, extranet, or intranet answers for the second blank: market, design, and export
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
In three to five sentences, describe how you can organize written information logically and sequentially
Answers: 1
You know the right answer?
In this lab assignment, you will help Professor P to implement the Grade Curve Calculator, which all...
Questions
question
Mathematics, 06.11.2020 07:40
question
Mathematics, 06.11.2020 07:40
question
Mathematics, 06.11.2020 07:50
question
Mathematics, 06.11.2020 07:50
question
Mathematics, 06.11.2020 07:50
question
French, 06.11.2020 07:50
question
Spanish, 06.11.2020 07:50