not to be read -
7th November 2002, 10:50 PM
#include <iostream.h>
bool determineCredit(int limit);
bool properMethod(int, char, char);
double calculate(int, int, char, char);
int main()
{
char food,grad;
int credit, room, cfood, cgrad;
cout<< "How many credits are you taking? ";
cin >> credit;
if (determineCredit(credit)==true)
{
cout << "\nRegular(1) or air conditioned room(2)(Choose between 1 and 2)? ";
cin >> room;
cout << "Do you want campus food?(y/n)? ";
cin >> food;
cout <<"Are you going to graduate(y/n)? ";
cin >>grad;
//cout << properMethod(room, food, grad) << endl;
if (properMethod(room,food, grad)==true)
{
if room==1
room=200;
else if room==2
room=250;
if (food=='y' || food=='Y')
cfood=400;
else if (food=='Y' || food=='N')
cfood=0;
if (grad=='y' || grad=='Y')
cgrad=400;
else if (grad=='Y' || grad=='N')
cgrad=0;
}
else
{
cout <<"You need to have a valid amount of credits" << endl;
}
return 0;
}
bool determineCredit(int limit)
{
if (limit<12 || limit>21)
return false;
else
return true;
}
bool properMethod(int r, char f, char g)
{
if ((r==1 || r==2) && (f=='y' || f=='n' || f=='Y' || f=='N') && (g=='Y' || g=='N' || g=='y' || g=='n'))
return true;
else
return false;
}
double calculate(int cCredit, int cRoom, char cFood, char cGrad)
{
return 0;
}
Ishwar ho ya Allah sab insaan ka bhalla karte hain
Woh insaan hai jo ek doosre ka galla kaatte hain
|