Anda di halaman 1dari 2

SAVE AS CPP

#include <iostream.h>
#include <stdlib.h>
#include <string>
using namespace std;

main()

{
char x;
string movieKind, movieName, customerName;
int finAmount, nodays;

cout << "Please Provide Customer Name:";


cin >> customerName;

cout << "\n" "\n" "Please provide Movie Description:" "\n" ;


cout << " Enter 'R'for Regular Movie:" "\n" ;
cout << " Enter 'C'for Children Movie:" "\n" ;
cout << " Enter 'N'for New Released Movie:" "\n";
cout << " Enter 'E'for English Movie: " "\n" "\n";

cin >> x;

cout<<"Please Provide Following Information:" "\n";


cout<< " Movie Name: ";
cin>> movieName;
cout<< " Number Of Days: ";
cin>>nodays;

if(x=='R')
{
finAmount=40*nodays;
movieKind="Regular";
}
else if (x=='C')
{
finAmount=30*nodays;
movieKind="Children";
}
else if (x=='N')
{
finAmount=100*nodays;
movieKind="New Release";
}
else if (x=='E')
{
finAmount=50*nodays;
movieKind="Regular";
}
else
{
finAmount=0*nodays;
movieKind="Invalid Movie Type";
}

cout<<" -----------------------------------------------------------" "\n";

cout<<" Customer Name:"<<customerName<< "\n";


cout<<" Movie Type : " <<movieKind<< "\n";
cout<<" Movie Name:"<<movieName<< "\n";
cout<<" Number of Days"<<nodays<< "\n";
cout<<" Your Rental Amount is: "<<finAmount<< "\n";
cout<<" ------------------------------------------------------------";