How To Write Car Rent Application Code Help Full in C++

Vu Old Solved Programming Based Assignments Codes are Available in this Section.
Post Reply
User avatar
ALI RAZA
★★★★★★★★★★★★★
★★★★★★★★★★★★★
Posts: 177
Joined: Fri Dec 22, 2017 8:10 am
Location: Lahore
Has thanked: 6 times
Been thanked: 7 times
Contact:
Status: Offline

How To Write Car Rent Application Code Help Full in C++

Post by ALI RAZA » Fri Aug 31, 2018 9:43 am

This Code Written By Ali Raza Tawry Car Rent Application Help Full in C++ Assignments of CS201 By Dr. Naveed A Malik
Download Exe File From Attachment Thanks You are required to write a program for RENT A CAR SYSTEM.
The basic idea is that user will provide customer information,
Car Model, and number of days.
Upon this information your program will calculate the Amount for the Car.
Rent Amount will be calculated on the Basis of Type
of Model he / she is going to take on Rent and of Days on Rent.
There are Types of Models available "2009", "2010" and "2011".
For Model 2009 Minimum Rent per day is Rs. 5000/- for Model "2010" Amount is Rs. 8000/-
and for "2011" Amount is Rs. 10,000/- Per Day.

Code: Select all

//You are required to write a program for RENT A CAR SYSTEM. 
//The basic idea is that user will provide customer information,
// Car Model, and number of days.
// Upon this information your program will calculate the Amount for the Car. 
// Rent Amount will be calculated on the Basis of Type 
//of Model he / she is going to take on Rent and of Days on Rent. 
//There are Types of Models available "2009", "2010" and "2011".
// For Model 2009 Minimum Rent per day is Rs. 5000/- for Model "2010" Amount is Rs. 8000/-
// and for "2011" Amount is Rs. 10,000/- Per Day. 






#include<iostream.h>
//function Decalration
int Rent(int,int);
main()
{    
     //charecter variable declration
      char name[50],modl,numbr[20];
      //intergers variables declration
      int dys,rent,amount,model;
      //Setting values of the intergers to calculation final result
      amount=0;
      rent=0;
      cout<<endl;
      cout<<endl;
      //Heading of the programe
      cout<<endl;cout<<"\t"<<"      Ali Raza Tawry www.vusociety.com"<<endl;
      cout<<"           *************************************";
      cout<<endl;cout<<"*\\Spaces are not allowed between letters of the Name of customer/*"<<endl;
      cout<<endl;
      cout<<endl;
      //Prompt The user To Enter the Name of the customer
      cout<<"\n Please Enter Name of The customer:"<<"\t";
      cin>>name;
      cout<<endl;
      //provide the car Models discription
      cout<<"Plese Provide Car Model disciption:"<<"\t";
      cout<<endl; 
      cout<<endl;
      cout<<endl;
      cout<<endl;
      cout<<"\t";
      cout<<"Enter 'A' For Model 2009"<<endl;
      cout<<"\t";
      cout<<"Enter 'B' For Model 2010"<<endl;
      cout<<"\t";
      cout<<"Enter 'C' For Model 2011"<<endl;
      cout<<endl;
      cout<<endl;
      cout<<endl;
      //prompt the user to which car he selected for rent
      cout<<"\nEnter Car  Model:";
      cin>>modl;cout<<endl;
      //prompt the user to provide the number of car which he slected
      cout<<"\nEnter Car Number:";
      cin>>numbr;cout<<endl;
      //prompt the user to put days for which he rented the car
      cout<<"\nEnter rent dayes:";
      cin>>dys;cout<<endl;cout<<endl;
      
      //use the switch structur for assinging value year car model to the car
      
      switch(modl)

{//if the user select A model than he is selecting 2009 model
      case'A':
      case'a':
              model=2009;
          
             
   //break of the stetment
      break;
     //if the user select B model than model assingned is 2010 
      case'B':
      case'b':
              model=2010;
        
        break;
     //if the user select C model than model assinged is 2011 
      case'C':
      case'c':
  
     model=2011;
     break;
     //used Default model for ending the satructure
     default:
     model=2012;
}//function whic we used to calculate the total rent amount
   rent=Rent(model,dys);

    cout<<"Customer Name:"<<name<<endl;
          cout<<endl; 
    cout<<"Car Number   :"<<numbr<<endl;
          cout<<endl; 
    cout<<"Car Model    :"<<model<<endl;
          cout<<endl; 
    cout<<"Rent Days    :"<<dys<<endl;
          cout<<endl; 
    cout<<"Rent Amount  :"<<rent; 
      cout<<endl;
      cout<<endl;
system("pause");
      
            






}//function defination that returnes amount value
int Rent(int model,int dys){int amount=0;
                             if(model==2009)
                               amount=dys*5000;
                             if(model==2010)
                             amount=dys*8000;
                             if(model==2011)
                             amount=dys*10000;
                             return amount;}
                                                  



Post Reply

Last 10 Members Who Visited This Topic

User avatar ALI RAZA (4)

  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest