Source code
C++ Assignment
Code:
#include <iostream>
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 <<endl<< " * Welcome to the Grade Checker *";
// 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 <<endl<< "Kindly Type your Marks in Mathematics = ";
cin >> math;
cout <<endl<< "Kindly Type your Marks in Communication Skillz = ";
cin >> comm;
cout <<endl<< "Kindly Type your Marks in Web Development = ";
cin >> web;
cout <<endl<< "Kindly Type your Marks in Pak Islamic Studies = ";
cin >> pak;
cout <<endl<< "Kindly Type your Marks in Intro to IT = ";
cin >> IT;
cout <<endl << "Kindly Type your Marks in Sociology = ";
cin >> sociology;
// addition of all marks
total= math+comm+web+pak+IT+sociology;
cout << endl <<"You have got "<< total <<"/600 Marks "<<endl;
// 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;
}
Screen Shot Download the attachment for yourself...