Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Guidelines § Code should be properly aligned and wellcommented. § Follow c/c++ r

ID: 3614224 • Letter: G

Question

Guidelines

§ Code should be properly aligned and wellcommented.

§ Follow c/c++ rules while writing variables names,function names etc

§ Use only dev-C++ for this assignment.

§ Use appropriate c/c++ structure i.e. if-else, switchstatement etc to get inputs from user

You are required to write a program for Movie Rental Store. Thebasic idea is that user/reader will provide customer information,movie name, and number of days. Upon this information your programwill calculate the charged amount for that movie.

Detailed Description:

1. The program should display

Please provide customer Name:

Please provide Movie Description.

       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 these inputs,

2. Depending upon the choices that user hasentered, your program will further display the prompt

3. If user has entered Movie description, thenyour program should prompt the user to enter the Movie Name andNumber of days.

     -----------------------------------------------------------------

          MovieName:            

          Number ofday’s:

      -----------------------------------------------------------------

4. After getting all this information, nowwrite a function which will calculate rental/charged amount on thebasis of this information.

   To calculate rental/charged amount we will use thisformula:

   Rental amount = charged amount * number ofdays

Charged amount will be different for different movies accordingto following description:

Regular Movie:       40 RS

ChildrenMovie:      30 RS

English Movie:       50 RS

New release:         100 RS

After calculating charged amount for this movie and display iton the screen.

Sample Output

Please provide customerName:      Aftab

Please provide Movie Description:

        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:      Jinnah           

      Number ofday’s:   3

Final output:

     -----------------------------------------------------------------

          CustomerName:    Aftab

          MovieType :     Regular    

          MovieName :      Jinah

          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;  
       
   
   
    }