Define a class called MoBike in C++ with following descriptions (Self Practice)

Private Members:
BNo //Integer type to store bike number.
CName //String type to store Customer Name.
PhNo //String type to store Customer Phone Number.
Days //Integer type to store Bike Taken on Rent.
Charges //Float type to store the total rental charges.

Public Members:
MoBike() //Default Constructor to initialize numeric data members to 0 and string data members to " ".
getData()  //Member function to take input and store the details of the customer also calling the compute function for Fare.
Compute() //Member function to calculate the rent for a MoBike is charged on the following basis:
First Five Days : Rs. 500 per day
Next Five Days : Rs. 400 per day
Rest of the Days : Rs. 200 per day
showData() //Member function to display the complete details of MoBike



No comments

Post your comments

Powered by Blogger.