Question: How would you make classes for this assignment? This is in C++ btw. Class structure assignment. This is what is asked for- This is what
How would you make classes for this assignment? This is in C++ btw. Class structure assignment.
This is what is asked for- 
This is what I already have written from a previous assignment we are supposed to go off of.
#include
#include
#include
using std::cout; using std::endl;
using std::cin;
using std:: trunc;
using std:: string;
void quit_grading(int command)
{
if (command == 1)
{
cout
}
else if (command == -1)
{
cout
}
else
{
cout
}
exit(0);
}
double get_grade()
{
string answer;
double grade_enter;
cout
cin>> answer;
//answer = "yes";
if (answer != "yes")
{
quit_grading(1);
}
else
{
cout
cin>> grade_enter;
//check the user is inputting valid grades
if ((grade_enter 100)
{
quit_grading(-1);
}
else
{
return grade_enter;
}
}
}
double get_average (std::array
{
double sum = 0;
double avg = 0;
int n=10;
for (int i = 0; i
{
//cout
sum += grades[i];
}
avg= sum/ n;
//cout
return avg;
}
int main()
{
//initialize variables
int n= 11;
int temp=0;
int pos;
double sum, avg= 0.0;
//arrays that will be used to store data
std::array
std::array
/*User instructions + initial loop to allow user to input their grades into array*/
cout
cout
cout
for (int i=0; i { cout grades[i]=get_grade(); } //find the lowest grade the student received double min = grades[0]; int min_index = 0; for (int i =1; i { if (grades [i] { min=grades [i]; min_index = i; } } grades[min_index]=grades[10]; grades[10]=min; /*I know this is not how I am supposed to do this part I am sorry I couldn't figure out how to remove a minimum element from an array*/ //cout // for (int i=0; i // { // grades[i]=grades[i+1]; // } n--; for (int i=0; i { cout } avg= get_average(grades); cout if (avg >=90) { cout } else if ((avg >=81) && (avg { cout } else if ((avg >=71) && (avg { cout } else if ((avg >=81) && (avg { cout } else if ((avg >=61) && (avg { cout } else { cout } quit_grading(0); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
