1/ Write a grading program for a class with the following grading policies:
a/ There are two quizzes ,each graded on the basis of 10 points .
b/there is one midterm exam and one final exam ,each graded on the basis of 100 points.
c/ The final exam counts for 50% of the grade , the midterm counts for 25% ,and the two quizzes together count for a total of 25%(Do not forget to normalize the quiz scores .They should be converd to a percent before they are averaged in)
Any grade of 90 or more is an A,any grade of 80 or more (but less than 90)is a B,any grade of 70 or more (but less than 80 )is a C,any grade of 60 or more (but less than 70) is a D,and any grade below 60 is an F.
The program will read in the student's scores and output the student's record,which consists of two quiz and two exam scores as well as the student's average numeric score for the entire course and the final letter grade.Define and use a structure for the students record .if this is class assignment ,ask your instuructor if input /output should be done with the keyboard and screen or if it should be done with fi;es .if it is to be done with files ,ask your instructor for instruction on file names
اقتباس#include <iostream>using namespace std;
int main()
{
int id,i,score,sum=0;
double average;
char grade ,ans;
cout<<"*&*&*&WeLeCom&*&*&*\n";
cout<<"Do you want to get average of the score ? \nEnter 'Y' if you want or enter 'N':";
cin>> ans;
while (ans=='Y'||ans=='y')
{cout << "Enter your id : ";
cin >> id;
for(i=1;i<4;i++)
{cout << "Enter the "<<i<<" score: ";
cin >> score;
sum+=score;}
average =sum /3.0;
if (average>=90)
grade='A';
else if (average>=80)
grade='B';
else if (average>=70)
grade='C';
else if (average>=60)
grade='D';
else if (average<60)
grade='F';
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout << "ID : " << id << " \nAverage : "<< average <<"\nGrade :"<< grade <<"\n";
cout<<"Good Luck\n";
cout<<"Do you want to get average of the score ? \nEnter 'Y' if you want or enter 'N':";
cin>> ans;}
return 0;
}
هذا الي فهمته الي يعرف classes
شلون تنتكتب ساعدوني
الي يعرفها