not to be read -
4th November 2002, 10:48 PM
#include <iostream.h>
int determine(int limit);
int main()
{
char food,grad;
int credit, room;
cout<< "How many credits are you taking? ";
cin >> credit;
if ((determine(credit))==1)
{
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;
}
else
{
cout <<"You need to have a valid amount of credits"; << endl;
return 0;
}
int determine(int limit)
{
if (limit<12 || limit>21)
return 0;
else
return 1;
}
int proper(r, f, g)
if (r==1 || r==2 && f==
--------------------------------------
#include <iostream.h>
#include <iomanip.h>
double salary(double, double);
void display(double, double, double);
int main()
{
double dollars,y1, y2, y3;
cout << "What is your current salary? ";
cin >> dollars;
y1=salary(dollars, .07);
y2=salary(y1, .06);
y3=salary(y2, .05);
display(y1, y2, y3);
return 0;
}
double salary(double money, double percent)
{
return ((money*percent) + money);
}
void display(double year1, double year2, double year3)
{
cout<< setiosflags(ios::fixed) << setprecision(2)
<<"\n\nYear:" << setw(16) <<"Salary:"
<<"\n-----" << setw(16) <<"-------"
<< "\nYear 1" << setw(9) <<"$"<< year1 <<"\nYear 2"
<<setw(9)<<"$"<<year2<<"\nYear 3"<<setw(9)
<<"$"<<year3 << endl;
}
Ishwar ho ya Allah sab insaan ka bhalla karte hain
Woh insaan hai jo ek doosre ka galla kaatte hain
|