Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

NAME : HAIDER ALI JADOON

ROLL NO : 237919
DEPARTMENT : MATHEMATICS
SEMESTER : 2ND
SUBMITTED TO: SIR MUDDASIR
DATE : 14/06/2024
PROGRAM:
#include <iostream>

using namespace std;

int main() {

cout << "BOARD OF INTERMEDIATE AND SECONDARY EDUCATION


ABBOTTABAD\n";

string name;

cout << "NAME: ";

getline(cin, name);

string fathername;

cout << "FATHER NAME: ";

getline(cin, fathername);

int rollnumber;

cout << "ROLL NUMBER: ";

cin >> rollnumber;

cin.ignore();

string college;

cout << "COLLEGE: ";

getline(cin, college);
int english, urdu, islamiyat, pakistanstudies, mathematics, physics,
computerscience;

cout << "Marks of English: ";

cin >> english;

cout << "Marks of Urdu: ";

cin >> urdu;

cout << "Marks of Islamiyat: ";

cin >> islamiyat;

cout << "Marks of Pakistan Studies: ";

cin >> pakistanstudies;

cout << "Marks of Mathematics: ";

cin >> mathematics;

cout << "Marks of Physics: ";

cin >> physics;

cout << "Marks of Computer Science: ";

cin >> computerscience;

int obtainedmarks = english + urdu + islamiyat + pakistanstudies +


mathematics + physics + computerscience;

int totalmarks;
cout << "Obtained marks is: " << obtainedmarks << "\n";

cout << "Total marks: ";

cin >> totalmarks;

float percentage = (obtainedmarks * 100.0) / totalmarks;

cout << "Percentage is: " << percentage << "%" << "\n";

int int_per = percentage / 10;

switch(int_per) {

case 9:

case 10:

cout << "Your grade is A+" << "\n";

break;

case 8:

cout << "Your grade is A" << "\n";

break;

case 7:

cout << "Your grade is B+" << "\n";

break;

case 6:

cout << "Your grade is B" << "\n";

break;

case 5:

cout << "Your grade is C" << "\n";

break;

case 4:
cout << "Your grade is D" << "\n";

break;

default:

cout << "Ohooo, you have failed" << "\n";

break;

return 0;

}
OUTPUT OF PROGRAM

You might also like