Powered By Blogger

Sunday 17 April 2011

CS201 SPRING ASSIGMENT1



#include <iostream.h>
#include <conio.h>

double TotalPayAbleRent(int,int);
main()
{
char name[20], choice,vehicle_number[20];
int total_days,amount_of_day1,amount_of_day2,amount_of_day3,model1,model2,model3;
model1 = 2009;
model2 = 2010;
model3 = 2011;
amount_of_day1 = 5000;
amount_of_day2 = 8000;
amount_of_day3 = 10000;
cout<<"=======CODDED BY: ALIMS(for those who are not much familiar with C++)=======";
cout<<"\n"<<"provide customer name :";
cin>>name;
cout<<"Please provide Car Description";
cout<<"\n"<<"Enter 'A' for model 2009";
cout<<"\n"<<"Enter 'B' for model 2010";
cout<<"\n"<<"Enter 'C' for model 2011";
cin>>choice;
cout<<"Please enter car number :";
cin>>vehicle_number;
cout<<"Please enter number of days :" ;
cin>>total_days;


if(choice=='a')
{

cout<<"<<endl;
cout<<"Customer Name :" <<name;
cout<<"\n"<<"Car Model :" <<model1 ;
cout<<"\n"<<"Number of days :" <<total_days;
cout<<"\n"<<"Your Rental Amount is :" <<TotalPayAbleRent(amount_of_day1,total_days);
cout<<"\n"<<"~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*." <<endl;
}
else if(choice=='A')
{

cout<<"~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*." <<endl;
cout<<"Customer Name :" <<name;
cout<<"\n"<<"Car Model :" <<model1 ;
cout<<"\n"<<"Number of days :" <<total_days;
cout<<"\n"<<"Your Rental Amount is :" <<TotalPayAbleRent(amount_of_day1,total_days);
cout<<"\n"<<"~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*." <<endl;
}
else if(choice=='B')
{

cout<<"~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*." <<endl;
cout<<"Customer Name :" <<name;
cout<<"\n"<<"Car Model :" <<model2 ;
cout<<"\n"<<"Number of days :" <<total_days;
cout<<"\n"<<"Your Rental Amount is :" <<TotalPayAbleRent(amount_of_day2,total_days);
cout<<"\n"<<"~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*." <<endl;
}
else if(choice=='b')
{

cout<<"~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*." <<endl;
cout<<"Customer Name :" <<name;
cout<<"\n"<<"Car Model :" <<model2 ;
cout<<"\n"<<"Number of days :" <<total_days;
cout<<"\n"<<"Your Rental Amount is :" <<TotalPayAbleRent(amount_of_day2,total_days);
cout<<"\n"<<"~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*." <<endl;
}
else if(choice=='C')
{

cout<<"~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*." <<endl;
cout<<"Customer Name :" <<name;
cout<<"\n"<<"Car Model :" <<model3 ;
cout<<"\n"<<"Number of days :" <<total_days;
cout<<"\n"<<"Your Rental Amount is :" <<TotalPayAbleRent(amount_of_day3,total_days);
cout<<"\n"<<"~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*." <<endl;
}
else if(choice=='c')
{

cout<<"~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*.~*." <<endl;
cout<<"Customer Name :" <<name;
cout<<"\n"<<"Car Model :" <<model3 ;
cout<<"\n"<<"Number of days :" <<total_days;
cout<<"\n"<<"Your Rental Amount is :" <<TotalPayAbleRent(amount_of_day3,total_days);
cout<<"\n"<<"~*."<<endl;
}
else
{
cout<<" input do";
}

getch();
}
double TotalPayAbleRent(int rentofday,int tdays)
{
return rentofday*tdays;
}






No comments:

Post a Comment