Written Assignment: Grade Book Program Your English instructor, realizing you ar
ID: 3626634 • Letter: W
Question
Written Assignment: Grade Book ProgramYour English instructor, realizing you are a programmer, asks you to write a Grade Book program for his class to help him compute final grades. Design a program that asks for the student’s name and four test grades. You are to display the student’s name, four test grades, the average of the four test grades and the final letter grade the student earned in the course.
Your English instructor gives you the following grading scale:
95-100 A+
90-94 A-
85-89 B+
80-84 B-
75-79 C+
70-74 C-
65-69 D+
60-64 D-
59 or below F
You are to submit, as a Microsoft Word Document, the following for this assignment:
1. Pseudocode
2. Flowchart
3. Program Code
Remember to follow the guidelines of good program design. Make sure to use meaningful variable names and thoroughly comment each line of your code. You may only use techniques learned in Modules One and Two.
Below is a screen output sample:
Student Name: Bob Jones
Test 1 Score: 94
Test 2 Score: 80
Test 3 Score: 73
Test 4 Score: 82
Student Average: 82
Student Final Grade: B-
Explanation / Answer
#include<iostream>
using namespace std;
int main()
{
string student_name="Aswani Kumar";
int a[]={94,80,73,82};
double avg;
int sum=0;
for(int i=0; i<4; i++)
sum = sum+a[i];
avg = sum/4.0;
cout << " Student Name: " << student_name<<endl;
for(int i=0; i<4; i++)
cout<< "Test " << (i+1) << " Score :" << a[i]<<endl;
cout<< "Student Average :"<<static_cast<int>(avg) << endl;
cout << "Student Final Grade :";
if(avg>=95 && avg<=100)
cout << "A+";
else if(avg<=94 && avg>=90)
cout << "A-";
else if(avg<=89 && avg>=85)
cout << "B+";
else if(avg<=84 && avg>=80)
cout << "B-";
else if(avg<=79 && avg>=75)
cout << "C+";
else if(avg<=74 && avg>=70)
cout << "C-";
else if(avg<=69 && avg>=65)
cout << "D+";
else if(avg<=64 && avg>=60)
cout << "D-";
else if(avg<=59)
cout << "F";
system("pause");
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.