Sajid Ali reg # 016

12

Transcript of Sajid Ali reg # 016

Presented to : Sir Hikmat Ullah Khan

Presented by : Sajid Ali

Reg # 016

GPA stands for Graded Point Average.

It is a Cumulative(total) gpa calculator.

Implementation of the procedure of the

calculation of Cgpa through programing.

In the start of the program:

It calls a function that welcomes the user

It tells the user that ita is a cgpa calculator.

This program follows the gpa calculating

rules of Comsats Attock

int CgpaCalculator::display() //Displays manu and welcomes the users... { cout<<"\n\t *************************************************"<<endl; cout<<"\n\t\t\t *** CIIT Attock ***"<<endl; cout<<"\t\t **** BS Computer Engineering 3 ****"<<endl; cout<<"\t\t **** Sajid Ali Khan Reg # 016 ****"<<endl; cout<<"\n\n\t **************************************************"<<endl; cout<<"\n\n\t**** CGPA Calculator in simple C++ Programing using Class

****"<<endl; cout<<"\n\n********************************************************************************"<

<endl; cout<<"\n\n\t\t\t Welcome to the Programme"<<endl; cout<<"\n This GPA calculator follows the gpa calculating rules of

COMSATS"<<endl;

}

It tells the user that if the user is a student

of Comsats

If yes , it promotes the user to enter his/her

details the program required.

It promotes the user to follow the

instructions.

int CgpaCalculator::verification() { int b; cout<<"\n\n\n Are you a student of comsats ? "<<endl; cout<<"\n\n Press 1 if yes other wise press any other number : "; cin>>b; if(b==0) { b=0; return a; } else { b=1; return b; }

}

It takes marks in a subject out of 100 and

the credit hours of that subject.

Then this program display the gpa of the

student in that subject

If the user enter invalid value it tells the

user that the value is invalid

cout<<"\nEnter marks of first subject:"; for(i=1;i<=subject;i++) { if(i!=1) { cout<<"\nEnter marks of next subject:"; } cin>>marks[i]; if(marks[i]>100 || marks[i]<0) {

cout<<"\Your entry is invalid "<<endl; cout<<"Run the programme

again"<<endl; return 0; } cout<<"\nEnter credit hours of this subject:"; cin>>c_hours; if(c_hours>4 || c_hours<1) { cout<<"You entered invalid value"<<endl; }

In the end this program tells the user that if he/she want to see his cgpa or continue calculating gpa of an other semester…

Piece of code…

cout<<"\nEnter 1 if you want to calculate gpa of another semester else press zero to see your Cgpa:"<<endl;

cin>>option;}