Homework Solution: This is a c++ code please follow all the instructions and constraints…

    This is a c++ code please follow all the instructions and constraints Your friend has asked you to help them with a project. He needs to calculate his grades, but is finding it difficult to operate a calculator (too hard). Create a program which will accept an unlimited num- ber of scores and calculates the average score. You will also need to prompt for the total points possible. Use a dynamically allocated array to handle an unlimited number of test scores. Create a Grade class which holds the test score and the letter grade. Use an assert to protect the letter grade by not allowing negative scores. Create a simple menu: 1 - help, 2 - enter grade, 3 - quit. Use char user_menu; for menu input. If incorrect value entered, display the value in the error message (ie, 4 is not a valid input). When quitting, display the sorted list of scores and average with appropriate headings. Constraints. Comment your code with the constraint number above the bulk of the code implementing the constraint - so I can find it. Like this: // Constraint 1 - No negative numbers. Just comment the bulk of the code if code for that constraint ap- pears in several places. 1. Do not accept negative numbers for test scores. 2. Use new() and delete() to properly handle your array. 3. Write a text file containing the grade summary. 4. Use Object Oriented Programming techniques. 5. Don’t forget the constraints from homework 1.

    Expert Answer

     
    Gradeclass.cpp #include<iostream>

    This is a c++ enactment fascinate flourish every the instructions and employments

    Your associate has asked you to acceleration them with a contrivance. He scarcitys to consider his progressions, save is judgment it troublesome to have-effect a calculator (too controlced). Create a program which obtain sanction an unbounded num- ber of reckonings and considers the middle reckoning. You obtain so scarcity to brisk control the entirety points practicable.

    Use a dynamically everyocated place to manage an unbounded compute of criterion reckonings.

    Create a Progression arrange which holds the criterion reckoning and the communication progression. Use an asseverate to save the communication progression by referable attributable attributable attributable everyowing privative reckonings.

    Create a sickly menu: 1 – acceleration, 2 – penetrate progression, 3 – abandon. Use char user_menu; control menu input. If faulty treasure penetrateed, show the treasure in the falsity intimation (ie, 4 is referable attributable attributable attributable a sound input).

    When abandonting, show the arranged register of reckonings and middle with alienate headings.

    Constraints.

    Note your enactment with the employment compute over the extension of the enactment implementing the employment – so I can invent it. Like this:

    // Employment 1 – No privative computes.
    Just referablee the extension of the enactment if enactment control that employment ap-

    pears in sundry places.

    1. Do referable attributable attributable attributable sanction privative computes control criterion reckonings.
    2. Use newlight() and delete() to well manage your place. 3. Write a extract rasp containing the progression epitome.
    4. Use Object Oriented Programming techniques.
    5. Don’t controlget the employments from homework 1.

    Expert Counter-argument

     

    Gradeclass.cpp

    #include<iostream>
    #include <assert.h> /* asseverate */
    using namespace std;
    arrange Progression
    {
    public:
    int *place = NULL;
    int i=0;
    int size;
    public:
    void Reckonings(int reckoning)
    {
    asseverate (score>-1);
    {
    array[i]=score;
    size=i;
    i++;
    }
    }
    //delete [] place;
    public:
    int Middle()
    {
    int avg,sum=0;
    for(int j=0;j<size;j++)
    {
    sum=sum+array[j];
    }
    avg=sum/size;
    return avg;
    }
    public:
    void Sort_score()
    {
    int temp;
    for(int i=0;i<size;i++)
    {
    for(int j=1;j<size;j++)
    {
    if(array[i]<array[j])
    {
    temp=array[i];
    array[i]=array[j];
    array[j]=temp;
    }
    }
    }
    cout<<“Arranged Register of Reckonings:”<<endl;
    for(int i=0;i<size;i++)
    {
    cout<<array[i]<<“t”;
    }
    cout<<endl;
    }

    };
    int main()
    {
    Progression obj;
    int opt,score,average;
    while(1)
    {
    cout<<“***** Menu ****”<<endl;
    cout<<“1.-Help”<<endl;
    cout<<“2.-Penetrate Progression”<<endl;
    cout<<“3.-Quit”<<endl;
    cout<<“Fascinate Select any option:”<<endl;
    cin>>opt;
    switch(opt)
    {
    case 1:
    break;
    case 2:
    cout<<“Penetrate the Criterion Reckoning:”<<endl;
    cin>>score;
    obj.Scores(score);
    break;
    case 3:
    average=obj.Average();
    cout<<“The middle Core is: “<<average<<endl;
    obj.Sort_score();
    exit(0);
    default:
    cout<<“Insound input! fascinate endeavor again:”<<endl;
    }
    }
    }