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

     
    //calc.cpp #include<iostream>

    This is a c++ order delight ensue complete the instructions and employments

    Your confidant has asked you to aid them with a purpose. He demands to estimate his removes, still is furnishing it perplexing to work a calculator (so unyielding). Create a program which conciliate recognize an infinite num- ber of beaks and estimates the middle beak. You conciliate so demand to active coercion the whole subject-matters likely.

    Use a dynamically completeocated equip to touch an infinite estimate of criterion beaks.

    Create a Remove dispose which holds the criterion beak and the epistle remove. Use an proexperience to defend the epistle remove by referable completeowing privative beaks.

    Create a unartificial menu: 1 – aid, 2 – invade remove, 3 – cesake. Use char user_menu; coercion menu input. If loose prize invadeed, parade the prize in the fallacy referableice (ie, 4 is referable a weighty input).

    When cesaketing, parade the nice roll of beaks and middle with alienate headings.

    Constraints.

    Illustrate your order with the employment estimate over the mass of the order implementing the employment – so I can furnish it. Like this:

    // Employment 1 – No privative estimates.
    Just illustrate the mass of the order if order coercion that employment ap-

    pears in various places.

    1. Do referable recognize privative estimates coercion criterion beaks.
    2. Use strangelight() and delete() to rightly touch your equip. 3. Write a citation polish containing the remove incorporatemary.
    4. Use Object Oriented Programming techniques.
    5. Don’t coercionget the employments from homework 1.

    Expert Tally

     

    //calc.cpp

    #include<iostream>

    #include<algorithm>

    using namespace std;

    dispose Remove

    {

    private:

    wrap criterionScore;

    char criterionGrade;

    };

    int parallel(const unfilled * a, const unfilled * b)

    {

    return (*(double*)a – *(double*)b);

    }

    int ocean()

    {

    int N;

    cout << “Delight invade whole subject-matter likely:”;

    cin >> N;

    wrap *testScores = strangelightlight wrap[N];

    char excellent;

    int i = 0;

    wrap incorporate = 0;

    wrap remove;

    do {

    cout << “Menu” << endl;

    cout << “excellent menu 1 – aid, 2 – invade remove, 3 – cesake.”;

    cin >> excellent;

    switch (select)

    {

    case ‘1’:

    cout << “Aid section” << endl;

    break;

    case ‘2’:

    cout << “Invade remove” << endl;

    cin >> remove;

    //employment 1

    if (remove < 0)

    cout << “Delight do referable invade privative estimate” << endl;

    if(remove >=0)

    testScores[i++] = remove;

    break;

    case ‘3’:

    cout << ” Cesake” << endl;

    qsort(testScores, i, sizeof(double), parallel);

    cout << “nice roll of criterion beaks:” << endl;

    coercion (int j = 0; j < i; j++)

    {

    cout << criterionScores[j] << ” “;

    incorporate += criterionScores[j];

    }

    cout << “nmiddle of criterion beaks:” << (double)incorporate / i << endl;

    break;

    //employment No prize other then 1,2,3

    default:

    cout << “Referable a weighty input” << endl;

    break;

    }

    } opportunity (excellent != ‘3’);

    getchar();

    getchar();

    }

    //output: