76 817
Assignments Done
98,5%
Successfully Done
In June 2019

Question #50431
1. Write a program that can enter marks for number of students and calculate their Total and class
average with the following format
The inputs:
ID (As 1 dimension array of Integers),marks(as 2 dimensional array of double), Grad (As 1 dimension
array of Chars)
The Grades are: A for 90’s, B for 80’s, C for 70’s, D for 60’s and F for less than 60.
Use the following functions to find
1. void inputID(int[]);
2. void inputMarks(double []);
3. void Total(double[]);
5. double ClassAverage(double[]);
6. void print(int[],double[],char[]);
The output:
St_Nm ID First Second Final Total Grade
1 20071156 15.5 16.5 30.1 62.1 D
2 20071154 15.0 16.5 30.1 62.6 D
Class average for 10 students is: 72.5

Writea program that can enter marks for number of students and calculate their Total
and class
average with the following format

The inputs:
ID (As 1 dimension array of Integers), First(As1 dimension array of Doubles), Second (As 1 dimension
array of Doubles), Final (As 1 dimension arrayof Doubles), Total (As 1 dimension array of Doubles), Grad
(As 1 dimension array of Chars)
The Grades are: A for 90’s, B for 80’s, C for70’s, D for 60’s and F for less than 60.

Example of the output:

St_Nm ID First Second Final Total Grade
1 20071156 15.5 16.5 30.1 62.1 D
2 20071154 15.0 16.5 30.1 62.6 D

Class average for 10 students is: 72.5

Solution.

//Connectinglibraries
#include<iostream>
#include<iomanip>

usingnamespace std;

constint SIZE = 10;

//Declaringof prototypes functions
voidinputID(int[]);
voidinputMarks(double[]);
doubleClassAverage(double []);
voidTotal(double[],double[],double [],double[]);
voidprint(int[] , double[],double[] , double[],double[], char[]);

//Create a main function
intmain()
{
//Declaringvariables
intID[SIZE]={0};
doublemarksFirst[SIZE]={0}, marksSecond[SIZE]={0}, marksFinal[SIZE]={0};
doubletotal[SIZE]={0};
doubleaverage[SIZE]={0};

//Callingfunctions
inputID(ID);

cout<<endl<<"First: "<<endl;
inputMarks(marksFirst);

cout<<endl<<"Second: "<<endl;
inputMarks(marksSecond);

cout<<endl<<"Final: "<<endl;
inputMarks(marksFinal);

//Callingfunction determination Total
Total(marksFirst, marksSecond,marksFinal, total);

//Callingfunction print

//Stop console
cin.get();
cin.get();
return 0;
}

voidinputID(int ID[])
{
for(int i=0; i<SIZE; i++)
{
cout<<"Enter ID for "<<i+1<< " student: ";
cin>>ID[i];
cout<<endl;
}
}

voidinputMarks(double marks[])
{
for(int i=0; i<SIZE; i++)
{
cout<<"Enter marks for "<<i+1<< " student: "<<endl;
cin>>marks[i];
cout<<endl;

}
}

voidTotal(double marksFirst[],double marksSecond[],doublemarksFinal[],double total[])
{
for(int i=0; i<SIZE; i++)
{
total[i] = marksFirst[i] +marksSecond[i] + marksFinal[i];
}
}

{

for(int i=0; i<SIZE; i++)
{
if(average[i] >= 90)
{
}
elseif (average[i] >= 80 && average[i]< 90)
{
}
elseif (average[i] >= 70 && average[i]< 80)
{
}
elseif (average[i] >= 60 && average[i]< 70)
{
}
elseif (average[i] < 60)
{
}
}

}

voidprint(int ID[] , doublemarksFirst[], double marksSecond[] , double marksFinal[], doubletotal[], char courseGrade[])
{
cout<<"St_Nm ID First Second Final Total Grade"<<endl;

for(int i=0; i<SIZE; i++)
{
cout<<endl;
}

cout<<endl<<endl<<"Class average for 10 students is: "<<ClassAverage(total);

}

doubleClassAverage(double total[])
{
doubleavg=0;

for(int i=0; i<SIZE; i++)
{
avg+=total[i];
}

returnavg/SIZE;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!