90 318
Assignments Done
99.3%
Successfully Done
In September 2020

# Answer to Question #50443 in C++ for Lia

Question #50443
1. Write a program that can enter marks for number of students and calculate their Total and class
average with the following format (((((WITHOUT using functions)))))

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 array of 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 for 70’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
1
2015-01-21T02:53:23-0500

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

usingnamespace std;

constint SIZE = 10;

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

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

//Inputmarks for first
cout<<endl<<"First: "<<endl;
cout<<"Enter marks for "<<i+1<< " student: "<<endl;
cin>>marksFirst[i];
cout<<endl;

//Inputmarks for second
cout<<endl<<"Second: "<<endl;
cout<<"Enter marks for "<<i+1<< " student: "<<endl;
cin>>marksSecond[i];
cout<<endl;

//Inputmarks for final
cout<<endl<<"Final: "<<endl;
cout<<"Enter marks for "<<i+1<< " student: "<<endl;
cin>>marksFinal[i];
cout<<endl;

}

//DeterminationTotal
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)
{
}
}

//Print
cout<<"St_Nm ID First Second Final Total Grade"<<endl;

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

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

cout<<endl<<endl<<"Class average for 10 students is: "<<avg/SIZE;

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

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!