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 22:30
One of your customers wants you to build a personal server that he can use in his home. one of his concerns is making sure he has at least one backup of their data stored on the server in the event that a disk fails. you have decided to back up his data using raid. since this server is for personal use only, the customer wants to keep costs down. therefore, he would like to keep the number of drives to a minimum. which of the following raid systems would best meet the customer's specifications? a. raid 0 b. raid 1 c. raid 5 d. raid 10
Answers: 3
question
Computers and Technology, 23.06.2019 07:00
1. you have a small business that is divided into 3 departments: accounting, sales, and administration. these departments have the following number of devices (computers, printers, etc.): accounting-31, sales-28, and administration-13. using a class c private network, subnet the network so that each department will have their own subnet. you must show/explain how you arrived at your conclusion and also show the following: all available device addresses for each department, the broadcast address for each department, and the network address for each department. also, determine how many "wasted" (not usable) addresses resulted from your subnetting (enumerate them).
Answers: 3
question
Computers and Technology, 23.06.2019 14:00
What is html ? give a small description about html
Answers: 2
question
Computers and Technology, 23.06.2019 16:30
If i wanted to include a built-in calendar in a document, what option could i select? draw table insert table insert chart quick tables
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
History, 22.11.2019 18:31
question
Social Studies, 22.11.2019 18:31
Questions on the website: 13722367