/********************************************************************************
Name: Result Card
Copyright: BCS-1A
Author: Muhammad Hussnain Imtiaz
Date: 25/12/11 13:01
Description: result card of seven subjects
*********************************************************************************/
# include <iostream>
# include <conio.h>
# include <string>
using namespace std ;
int main()
{
// Local declaration
int rollNo =0,
subject1 =0,
subject2 =0,
subject3 =0,
subject4 =0,
subject5 =0,
subject6 =0,
subject7 =0;
string name ;
double percentage=0.0,
sum = 0.0,
totalMark= 0.0;
cout << "Enter your name :" ;
getline (cin, name);
cout << "Enter Roll Number :" ;
cin >> rollNo ;
cout << "Enter your 1st subject Maks :" ;
cin >> subject1 ;
cout << "Enter your 2nd subject Maks :" ;
cin >> subject2 ;
cout << "Enter your 3rd subject Maks :" ;
cin >> subject3 ;
cout << "Enter your 4th subject Maks :" ;
cin >> subject4 ;
cout << "Enter your 5th subject Maks :" ;
cin >> subject5 ;
cout << "Enter your 6th subject Maks :" ;
cin >> subject6 ;
cout << "Enter your 7th subject Maks :" ;
cin >> subject7 ;
cout << "\nEnter Total Marks :" ;
cin >> totalMark ;
sum = subject1 + subject2 + subject3 + subject4 + subject5 + subject6 + subject7 ;
percentage = (sum / totalMark) * 100.0 ;
system ("CLS") ;
cout << "*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*";
cout << endl << " Name :" << name ;
cout << endl << " Roll No. :" << rollNo ;
cout << endl << " 1st Subject Marks :" << subject1;
cout << endl << " 2nd Subject Marks :" << subject2;
cout << endl << " 3rd Subject Marks :" << subject3;
cout << endl << " 4th Subject Marks :" << subject4;
cout << endl << " 5th Subject Marks :" << subject5;
cout << endl << " 6th Subject Marks :" << subject6;
cout << endl << " 7th Subject Marks :" << subject7;
cout << endl << " Total Marks :" << totalMark << " Obtained Marks :" << sum ;
cout << endl << " Percentage :" << percentage ;
cout << endl ;
if (percentage>=90.0)
{
cout << " Grade :A+" ;
}
else if (percentage>=80.0)
{
cout << " Grade :A" ;
}
else if (percentage>=70.0)
{
cout << " Grade :B" ;
}
else if (percentage>=60.0)
{
cout << " Grade :C" ;
}
else if (percentage>=50.0)
{
cout << " Grade :D" ;
}
else if (percentage>=40.0)
{
cout << " Grade :E" ;
}
else if (percentage<40.0)
{
cout << " Grade :F" ;
}
cout << endl << "*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*" ;
cout << "\nPress any key" ;
getch ();
system ("CLS");
cout << "\n\n\n\n\n\n\n\n\n Created By:Mohammad Hussnain Imtiaz" ;
getch () ;
return 0 ;
}
No comments:
Post a Comment