Please provide customer Name: Please provide MovieDescription. Enter ‘R’for Regu
ID: 3614395 • Letter: P
Question
Please provide customer Name:
Please provide MovieDescription.
Enter ‘R’for Regular Movie.
Enter ‘C’for children Movie.
Enter ‘N’for New Released Movie.
Enter ‘E’for English Movie.
Then your program should take theseinputs,
2. Depending upon the choices that user has entered, your program willfurther display the prompt
3. If user has entered Movie description, then your program shouldprompt the user to enter the Movie Name and Number of days.
-----------------------------------------------------------------
MovieName:
Number ofday’s:
-----------------------------------------------------------------
4. After getting all this information, now write a function which willcalculate rental/charged amount on the basis of thisinformation.
To calculaterental/charged amount we will use this formula:
Rental amount = charged amount * number of days
Charged amount will be different fordifferent movies according to following description:
RegularMovie: 40 RS
ChildrenMovie: 30 RS
EnglishMovie: 50 RS
Newrelease: 100RS
After calculating charged amount for this movie and display iton the screen.
SampleOutput
Please provide customerName: Aftab
Please provide MovieDescription:
Enter ‘R’for Regular Movie:
Enter ‘C’for children Movie:
Enter ‘N’for New Released Movie:
Enter ‘E’for English Movie:
R
Please provide following information:
Movie Name: Titanic
Number ofday’s: 3
Final output:
-----------------------------------------------------
CustomerName: Aftab
MovieType : Regular
MovieName : Titanic
Number ofday’s: 3
YourRental Amount is: 120 Rs
Explanation / Answer
#include<iostream.h>
intrentalamount(int,int);
main(){
charoption,name[50],mname[50];
int amo,nod;
cout<<"Please provide customerName:";
cin>>name;
cout<<"Please provide MovieDescription. ";
cout<<"Enter 'R' for RegularMovie. "<<"Enter 'C' for children Movie. ";
cout<<"Enter 'N' for New ReleasedMovie.. "<<"Enter 'E' for English Movie. ";
cin>>option;
cout<<"Movie Name : ";
cin>>mname;
cout<<"Number of day's:";
cin>>nod;
switch (option){
case 'R':{
cout<<"final Output .......................";
cout<<" Customer Name: "<<name;
cout<<" Movie Type: Regular";
cout<<" Number of day's:"<<nod;
cout<<" Your Rental Amountis:"<<rentalamount(40,nod)<<" ....................... ";
break;
}
case 'C':{
cout<<"final Output .......................";
cout<<" Customer Name: "<<name;
cout<<" Movie Type: Children Movie";
cout<<" Number of day's:"<<nod;
cout<<" Your Rental Amountis:"<<rentalamount(30,nod)<<" ....................... ";
break;
}
case 'N':{
cout<<"final Output .......................";
cout<<" Customer Name: "<<name;
cout<<" Movie Type: New Released Movie";
cout<<" Number of day's:"<<nod;
cout<<" Your Rental Amountis:"<<rentalamount(50,nod)<<" ....................... ";
break;
}
case 'E': {
cout<<" final Output .......................";
cout<<" Customer Name: "<<name;
cout<<" Movie Type: English Movie";
cout<<" Number of day's:"<<nod;
cout<<" Your Rental Amountis:"<<rentalamount(50,nod)<<" ....................... ";
break;
}
default : cout<<"please chosefrom the list ";
};// switch close
system("pause");
}
int rentalamount(int charges,int day){
int ramount;
return ramount=charges*day;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.