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 23:30
Jaina and tomas are being considered as new tenants in an apartment. the landlord looks at their creditworthiness because he wants to be sure his new tenant pays the rent on time and in full. the table below summarizes the information that was on their applications. application information questions jaina tomas how many years have you had your job? 5 2 what is your monthly salary? $1,850 $2,500 how many credit cards do you have? 4 1 how much debt do you have? $13,000 $7,000 how many times were you late with payments on credit cards in the past year? 5 1 who will the landlord decide to be more creditworthy and why? tomas because the ratio of his debt to income is less. jaina because she has had her job longer, which makes her look more stable. jaina because she has more credit cards available to her. tomas because he makes more money per month.
Answers: 2
question
Computers and Technology, 23.06.2019 20:40
Instruction active describing list features which statements accurately describe the features of word that are used to create lists? check all that apply. the tab key can be used to create a sublist. the enter key can be used to add an item to a list. the numbering feature allows for the use of letters in a list. the numbering feature can change the numbers to bullets in a list. the multilevel list feature provides options for different levels in a list.
Answers: 2
question
Computers and Technology, 24.06.2019 09:50
Self contained sequences of actions to be performed are? a. expressions b. algorithms c. functions d. formulas
Answers: 1
question
Computers and Technology, 24.06.2019 13:00
In a heat transfer course, we can derive the equation for the temperature distribution in a flat rectangular plate. in this example, we will look at a plate at steadystate with three sides being held at t1, and one side held at t2. the temperature for any location on the plate, t(x,y), can be calculated by where create a function (prob3_5) that will take inputs of vectors x and y in feet, scalar n, scalars l and w in feet and scalars t1 and t2 in degrees fahrenheit. it will output a matrix t which is the temperature of each x and y locations. t will have the number of columns equal to the number of elements in x and rows equal to the number of elements in y. though this can be done without loops (perhaps more efficiently), your program must use a nested loop.
Answers: 2
You know the right answer?
In this lab assignment, you will help Professor P to implement the Grade Curve Calculator, which all...
Questions
question
Chemistry, 14.09.2020 21:01
question
Mathematics, 14.09.2020 21:01
question
Mathematics, 14.09.2020 21:01
question
English, 14.09.2020 21:01
question
Mathematics, 14.09.2020 21:01
question
Social Studies, 14.09.2020 21:01
question
English, 14.09.2020 21:01
question
Mathematics, 14.09.2020 21:01
question
Mathematics, 14.09.2020 21:01
question
Mathematics, 14.09.2020 21:01
question
Mathematics, 14.09.2020 21:01
question
Social Studies, 14.09.2020 21:01
question
Mathematics, 14.09.2020 21:01
question
Mathematics, 14.09.2020 21:01
question
Chemistry, 14.09.2020 21:01
question
English, 14.09.2020 21:01
question
Mathematics, 14.09.2020 21:01
question
Chemistry, 14.09.2020 21:01
question
Geography, 14.09.2020 21:01
Questions on the website: 13722367