Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cs201 solution idea on 15th April 2011
#1
Do not copy the whole code. Try to make changes. Like change the variable name and also change the function name. It will be better. the Good programming practice is this give comments then it will be fine.
[Image: cplusplus.jpg]
#include<conio.h>
#include<iostream.h>
void rent(void);
main()
{

rent();

getch();
}
void rent(void)
{
char option,customer_name[15],car_no[7];
int carmodel,days,rentamount,chargamount;
cout<<"please provide customer name:"<<endl;
cin>>cus_name;
cout<<"please provide car model description\n Enter 'A' for model 2009.\nEnter 'B' for

model 2010.\nEnter 'C' for model 2011.\n"<<endl;
cin>>option;
cout<<"please provide car No:"<<endl;
cin>>car_no;
cout<<"please provide number of Day's"<<endl;
cin>>days;
if(option=='A')
{
model=2009;
charged_amount=5000;
cout<<"customer name: "<<customer_name<<endl;
cout<<"Car Model : "<<carmodel<<endl;
cout<<"Number of days: "<<days<<endl;
cout<<"Car No. : "<<carno<<endl;
rentamount=chargamount*days;
cout<<"Your Rental Amount is: "<<rentamount<<endl;

}
else if(option=='B')
{
model=2010;
charged_amount=8000;
cout<<"customer name: "<<customer_name<<endl;
cout<<"Car Model : "<<carmodel<<endl;
cout<<"Number of days: "<<days<<endl;
cout<<"Car No. : "<<carno<<endl;
rentamount=chargamount*days;
cout<<"Your Rental Amount is: "<<rentamount<<endl;
}
else if(option=='C')
{
model=2011;
charged_amount=10000;
cout<<"customer name: "<<customer_name<<endl;
cout<<"Car Model : "<<carmodel<<endl;
cout<<"Number of days: "<<days<<endl;
cout<<"Car No. : "<<carno<<endl;
rentamount=chargamount*days;
cout<<"Your Rental Amount is: "<<rentamount<<endl;
}
else
cout<<"You must be enter only A,B,C Right Now"<<endl;
}

Please make some change Otherwise U get 0 marks Confusedmileys4:


Attached Files
.zip   ass.zip (Size: 541 bytes / Downloads: 319)
Reply
#2
yaar ya prog microsoft wold man likhna yaa c++ man? plz reply
Reply
#3
c++ ,mein .cpp ki file send kerni hai un ko
Reply
#4
yah app logo nay acha question keya. yah .cpp main save kerna hai aur compile ker kay dekhna hai how it is working then you have to upload it on vulms. Please read your instructions carefully inside the assignment file.
Reply
#5
Here is the Compile code And all errors fixed:-
PHP Code:
#include<conio.h>
#include<iostream.h>
void rent(void);
main()
{

rent();

getch();
}
void rent(void)
{
char option,customer_name[15],car_no[7];
int carmodel,days,rentamount,chargamount;
cout<<"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"<<endl;
cout<<"please provide customer name:"<<endl;
cin>>customer_name;
cout<<"please provide car model description\n Enter 'A' for model 2009.\nEnter 'B' for model 2010.\nEnter 'C' for model 2011.\n"<<endl;
cin>>option;
cout<<"please provide car No:"<<endl;
cin>>car_no;
cout<<"please provide number of Day's"<<endl;
cin>>days;
cout<<"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"<<endl;
if(
option=='A')
{
carmodel=2009;
chargamount=5000;
cout<<"customer name: "<<customer_name<<endl;
cout<<"Car Model : "<<carmodel<<endl;
cout<<"Number of days: "<<days<<endl;
cout<<"Car No. : "<<car_no<<endl;
rentamount=chargamount*days;
cout<<"Your Rental Amount is: "<<rentamount<<endl;

}
else if(
option=='B')
{
carmodel=2010;
chargamount=8000;
cout<<"customer name: "<<customer_name<<endl;
cout<<"Car Model : "<<carmodel<<endl;
cout<<"Number of days: "<<days<<endl;
cout<<"Car No. : "<<car_no<<endl;
rentamount=chargamount*days;
cout<<"Your Rental Amount is: "<<rentamount<<endl;
}
else if(
option=='C')
{
carmodel=2011;
chargamount=10000;
cout<<"customer name: "<<customer_name<<endl;
cout<<"Car Model : "<<carmodel<<endl;
cout<<"Number of days: "<<days<<endl;
cout<<"Car No. : "<<car_no<<endl;
rentamount=chargamount*days;
cout<<"Your Rental Amount is: "<<rentamount<<endl;
}
else
cout<<"You must be enter only A,B,C Right Now"<<endl;
} 
Reply
#6
cout<<"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"<<endl;
Reply
#7
es ka code ka kya matlab hoa cout<<"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"<<endl;
Reply
#8
cout is used to displayed what ever you type in.
Reply
#9
You can cut this line if u want nothing happens if you cut
Reply
#10
[COLOR="red"]hello admin why u disable the edit button? if some to want to edit there post but cannot please check the setting in admincp.
[/COLOR]
[SIZE="7"][SIZE="7"]Thanks[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  get your solution in 24 hours 2020 Xpert 0 8,800 10-11-2020, 10:09 PM
Last Post: Xpert
  get your solution in 24 hours 2020 Xpert 0 3,180 10-11-2020, 10:09 PM
Last Post: Xpert
  vuhelp.com forum is providing solution of virutal university students in 24 hour 2014 Xpert 3 2,489 11-17-2014, 06:11 PM
Last Post: leo861323
  GDB of FIN730 - Investment Analysis & Portfolio Management (Need Solution) Muhammad Husnain Mughal 1 1,876 05-15-2014, 08:21 PM
Last Post: hondasr8
  GDB of FIN723 - Taxation Management (Need Solution) Muhammad Husnain Mughal 1 2,930 05-07-2014, 04:09 AM
Last Post: Vuhelper
  Need ACC501 - Business Finance Assignment No 2 Solution. Umar Abbas 2 4,251 02-07-2014, 08:23 PM
Last Post: Umar Abbas
  operating assinment solution help nenanena 9 6,098 08-18-2013, 03:53 AM
Last Post: Xpert
  Need Assignments solution detailer 2 3,142 11-21-2012, 02:52 PM
Last Post: Vuhelper
  need fall 2012 mgt111 gdb solution urgently eshal ch 1 3,064 11-16-2012, 12:16 AM
Last Post: Vuhelper
  Urgent need Cs201 first assignmt solution r_traveler 4 2,266 11-07-2012, 01:47 AM
Last Post: Xpert

Forum Jump:


Users browsing this thread: 1 Guest(s)