87 031
Assignments Done
98.4%
Successfully Done
In May 2020

# Answer to Question #48856 in C++ for ehab

Question #48856
Write a program that can enter marks for 1 student and calculate his total and grade with the following format The inputs: ID (As Integer), First (As Double), Second (As Double), Final (As Double), Total (As Double) and Grad (As Char) 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. The output: St_Nm ID First Second Final Average Grade 1 20071156 15.5 16.5 30.1 62.1 D
1
2014-11-18T00:48:35-0500
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int ID;
double First, Second, Final, Total;
cout<<"Enter ID : ";
cin>>ID;
cout<<"Enter First mark : ";
cin>>First;
cout<<"Enter Second mark : ";
cin>>Second;
cout<<"Enter Final mark : ";
cin>>Final;
Total = First + Second + Final;
if (Total>=90 && Total <=100) Grade = 'A'; else if(Total >= 80 && Total < 90) Grade = 'B';
else if(Total >= 70 && Total < 80) Grade = 'C';
else if(Total >= 60 && Total < 70) Grade = 'D';
if(Total > 100)
{
Total = 0;
cout<<"There is an error! Total is over 100!"<<endl;
}
_getch();
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!