| .BZU. | 04-04-2008 01:48 AM | 2 Attachment(s) Source code
C++ Assignment Code:
#include
using namespace std;
int main ()
{
/* I am designing this software for those students who want to calculate
Their total marks, percentage and their Grades, with the hope that this
program will help the all students*/
cout <
// float type identifier are defined for the cin command and calculation
float math,comm,web,pak,IT,sociology,total,percentage;
/* character type identifier are defined we use them for showing the
Grades of the students in the exams */
char gradeA,gradeB,gradeC,gradeD;
/* Here cout command requests the users to type their marks in
different subjects and cin command fetch the given values and assign
to their corresponding identifiers*/
cout < // addition of all marks
total= math+comm+web+pak+IT+sociology;
cout << endl <<"You have got "<< total <<"/600 Marks "<
// Percentage Calculation
percentage= total/600*100;
cout << "you have got "<< percentage << " Percant Marks "<< endl;
// Values given to all char type identifier; equal to the grade of students
gradeA = 'A';
gradeB = 'B';
gradeC = 'C';
gradeD = 'D';
/* if else statements are used to check the grades of the students these
grades are assigned to the students on the basis of their percentage */
if (percentage <60 )
{
cout << " And your Grade is "<< gradeD << endl;
cout << "Please Improve yourself "<< endl;
cout << "You may consider as a fail studnet "<< endl;
}
else
if ((percentage>=60)&&(percentage<70))
{ cout << " And your Grade is "<< gradeC << endl;
cout << " Nice performance "<< endl;
}
else
if ((percentage>=70)&&(percentage<85))
{ cout << " And your Grade is "<< gradeB << endl;
cout << " You are the brilliant Student "<< endl;
}
else
{ cout << " And your Grade is "<< gradeA << endl;
cout << " Excellent Performance And you are the most wanted "<< endl;
}
return 0;
} Download the attachment for yourself... |