Sie sind auf Seite 1von 4

Assignment # 3

#include<iostream>

#include<conio.h>

using namespace std;

int main()

float comm,arabic,calculus,algebra,fop,physics ;

cout << "Enter your Marks in Communication skills: ";

cin >> comm;

float c=comm;

if(comm>100) cout<<"Error: Marks Can not be > 100\n";

else if (comm >= 80) comm=4.0;

else if (comm >= 75) comm=3.5;

else if (comm >= 70) comm=3.0;

else if (comm >= 65) comm=2.5;

else if (comm >= 60) comm=2.0;

else if (comm >= 55) comm=1.5;

else if (comm >= 50) comm=1.0;

else if (comm >= 0) comm=0.0;

else cout << "Error: Marks can not be less than 0.\n";

cout << "Enter your Marks in Calculus: ";

cin >> calculus;

float cal=calculus;

if(calculus>100) cout<<"Error: Marks Can not be > 100\n";

else if (calculus >= 80) calculus=4.0;


else if (calculus >= 75) calculus=3.5;

else if (calculus >= 70) calculus=3.0;

else if (calculus >= 65) calculus=2.5;

else if (calculus>= 60) calculus=2.0;

else if (calculus >= 55) calculus=1.5;

else if (calculus >= 50) calculus=1.0;

else if (calculus >= 0) calculus=0.0;

else cout << "Error: Marks can not be less than 0.\n";

cout << "Enter your Marks in Arabic: ";

cin >> arabic;

float a=arabic;

if(arabic>100) cout<<"Error: Marks Can not be > 100\n";

else if (arabic >= 80) arabic=4.0;

else if (arabic >= 75) arabic=3.5;

else if (arabic >= 70) arabic=3.0;

else if (arabic >= 65) arabic=2.5;

else if (arabic>= 60) arabic=2.0;

else if (arabic >= 55) arabic=1.5;

else if (arabic >= 50) arabic=1.0;

else if (calculus >= 0) calculus=0.0;

else cout << "Error: Marks can not be less than 0.\n";

cout << "Enter your Marks in Linear Algebra: ";

cin >> algebra;

float alg=algebra;

if(arabic>100) cout<<"Error: Marks Can not be > 100\n";


else if (algebra >= 80) algebra=4.0;

else if (algebra >= 75) algebra=3.5;

else if (algebra >= 70) algebra=3.0;

else if (algebra >= 65)algebra=2.5;

else if (algebra>= 60) algebra=2.0;

else if (algebra >= 55) algebra=1.5;

else if (algebra >= 50) algebra=1.0;

else if (algebra >= 0) algebra=0.0;

else cout << "Error: Marks can not be less than 0.\n";

cout << "Enter your Marks in Fundamentals og programming: ";

cin >> fop;

float fo=fop;

if(arabic>100) cout<<"Error: Marks Can not be > 100\n";

else if (fop >= 80) fop =4.0;

else if (fop >= 75) fop =3.5;

else if (fop >= 70) fop =3.0;

else if (fop >= 65) fop=2.5;

else if (fop >= 60) fop=2.0;

else if (fop >= 55) fop=1.5;

else if (fop >= 50) fop=1.0;

else if (fop >= 0) fop=0.0;

else cout << "Error: Marks can not be less than 0.\n";

cout << "Enter your Marks in Engeneering Physics : ";

cin >> physics;

float p=physics;

if(arabic>100) cout<<"Error: Marks Can not be > 100\n";


else if (physics >= 80) physics =4.0;

else if (physics >= 75) physics =3.5;

else if (physics >= 70) physics =3.0;

else if (physics >= 65) physics=2.5;

else if (physics >= 60) physics=2.0;

else if (physics >= 55) physics=1.5;

else if (physics >= 50) physics=1.0;

else if (physics >= 0) physics=0.0;

else cout << "Error: Marks can not be less than 0.\n";

float GPA = ((comm*2)+(arabic*2)+(physics*3)+(calculus*3)+(algebra*3)+


(fop*3))/16;

float percentage = (c+a+p+alg+cal+fo)/600*100;

cout<<"Percentage : " <<percentage <<endl;

cout<<" GPA =" <<GPA <<endl;

getch();

return 0;

Das könnte Ihnen auch gefallen