Question
I'm having trouble with this assignment. This is the code I have so far. Thank you. #include using namespace std; int main() { int* grades
I'm having trouble with this assignment. This is the code I have so far. Thank you.
#include
using namespace std;
int main()
{
int* grades = nullptr;
int nGrades = 0;
double median;
cout
cin >> nGrades;
grades = new int[nGrades];
for(int i=0;i { cout cin >> *(grades+1); } int total = 0; for (int i = 0; i { total += *(grades+1); } if(nGrades%2==1) { median = (double)*(grades+(nGrades/2)); } median = (double)(*(grades+(nGrades/2))+*(grades+(nGrades/2)))/2; cout }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started