Tera Saroor Program#16: To Calculate Grades by Entering Obtained Marks
Tera Saroor Program#16: To Calculate Grades by Entering Obtained Marks
int main()
int a , total=100;
cin>>a;
if (a<=49)
else if (a>=50&&a<=54)
else if (a>=55&&a<=59)
else if (a>=60&&a<=64)
else if (a>=65&&a<=69)
else if (a>=70&&a<=74)
else if (a>=75&&a<=79)
else if (a>=80&&a<=84)
else if (a>=85&&a<=89)
else if (a>90&&a<=100)
else
Manual 4 Page 1
cout <<"Enter valid marks"<<endl;
system ("pause");
return 0;}
Program#17
To calculate the driving cost of one day.
#include <iostream>
int main()
int coog,tpd,pf;
cin>>mile;
cin>>ampg;
cin>>coog;
cin>>tpd;
cin>>pf;
gu=mile/ampg;
cout<<gu;
coopd=gu*coog;
tcpd=coopd+tpd+pf;
return 0;}
Program#18
To check if the person is eligible for insurance or not.
Manual 4 Page 2
#include <iostream>
int main()
int age ;
cin>>age;
cin>>ms;
cin>>gender;
if (ms=='m')
else if (ms=='u'&&gender=='M'&&age>30)
else if (ms=='u'&&gender=='F'&&age>25)
else
return 0;}
Program#19
To calculate fine charged by library if the book is returned late.
#include <iostream>
int main()
int x;
cin>>x;
Manual 4 Page 3
if (x<=5)
else if (x>5&&x<=10)
else if (x>10&&x<=30)
else if (x>30)
return 0;}
Program#20
To calculate the salary of an employ.
#include <iostream>
int main()
int yos;
cin>>gender;
cin>>qal;
cin>>yos;
if(gender=='m'&&qal=='p'&&yos>=10)
if(gender=='m'&&qal=='g'&&yos>=10)
if(gender=='m'&&qal=='p'&&yos<10)
if(gender=='m'&&qal=='g'&&yos<10)
Manual 4 Page 4
cout <<"Salery is 700"<<endl;
if(gender=='f'&&qal=='p'&&yos>=10)
if(gender=='f'&&qal=='g'&&yos>=10)
if(gender=='f'&&qal=='p'&&yos<10)
if(gender=='f'&&qal=='g'&&yos<10)
system ("pause");
return 0;
Manual 4 Page 5