SRS Cinema has decided to upgrade its application and provide a feature to buy tickets online itself. A user can make payments through three methods-Cash, Wallet, or Credit Card. For all three, a different set of information needs to be asked from the user. For cash type payment only the amount needs to be asked and for wallet type, payment wallet number is also required. For a credit card type payment ask for the necessary card details required to make the payment. Use the concept of method overloading to add functionality to the website. Write a C++ program to create a class and implement the above functionality using member functions of the same name with different parameters. Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement. A class named TicketBooking has the following private member variables Data Type Variable name string name string walletNumber string creditcard string ccv double amount Define the attributes and Include appropriate constructors, setters, and getters for the above class In TicketBooking class include the following member function Method name Description void makePayment(double amounts) This function is used to make payments using cash and to display the details. void makePayment(string walletnumbers,double amounts) This function is used to make the payment using wallet number and also display the details. void makePayment(string creditcards,string ccvs,string names,double amounts) This function is used to make the payment through credit card using necessary details and display the amount along with the credit card number.   In the main method, get the input from the user based on the payment mode they select. Pass the necessary inputs to the corresponding methods for the payment and display the details with two decimal places for the amount.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

1:- QUESTION PROVIDED BELOW. MATCH OUTPUT AS IT IS.

 

2:- AND USE TEMPLATE PROVIDED AT END 

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

SRS Cinema has decided to upgrade its application and provide a feature to buy tickets online itself. A user can make payments through three methods-Cash, Wallet, or Credit Card. For all three, a different set of information needs to be asked from the user. For cash type payment only the amount needs to be asked and for wallet type, payment wallet number is also required. For a credit card type payment ask for the necessary card details required to make the payment. Use the concept of method overloading to add functionality to the website.


Write a C++ program to create a class and implement the above functionality using member functions of the same name with different parameters.

Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement.

A class named TicketBooking has the following private member variables

Data Type Variable name
string name
string walletNumber
string creditcard
string ccv
double amount

Define the attributes and Include appropriate constructorssetters, and getters for the above class

In TicketBooking class include the following member function

Method name Description
void makePayment(double amounts) This function is used to make payments
using cash and to display the details.
void makePayment(string walletnumbers,double amounts) This function is used to make the payment
using wallet number and also display the details.
void makePayment(string creditcards,string ccvs,string names,double amounts) This function is used to make the payment
through credit card using necessary details
and display the amount along with the credit card number.

 

In the main method, get the input from the user based on the payment mode they select. Pass the necessary inputs to the corresponding methods for the payment and display the details with two decimal places for the amount.

Input and Output format:
Refer sample input and output for formatting specifications.

Note: Display the amount in two decimal places.


[All text in bold corresponds to input and the rest corresponds to output]

Sample Input and Output 1:
Payment methods                                           
1.Cash payment                                          
2.Wallet payment                                                 
3.Credit card payment                
Enter your option:                                                 
                                    
Enter the amount :   
1000.50                                       
Amount Rs.1000.50 paid in cash

Sample Input and Output 2:
Payment methods                                        
1.Cash payment          
2.Wallet payment         
3.Credit card payment
Enter your option:
2        
Enter the amount :        
3000
Enter the wallet number:
AHGI-6543                
Amount Rs.3000.00 paid using wallet number AHGI-6543

Sample Input and Output 3:
Payment methods                
1.Cash payment            
2.Wallet payment                
3.Credit card payment            
Enter your option:
3               
Enter the amount :
4500.60                      
Enter the credit card number:
9871-7890-4500-3199                                                                                                          
Enter the ccv number:
874                                                                                                                          
Enter name:
Guhan
Amount Rs.4500.60 paid using credit card 9871-7890-4500-3199

 

----------USE BELOW TEMPLATE WHILE MAKING SOLUTION--------------

 

main.cpp

#include<iostream>
#include<string>
#include "TicketBooking.cpp"
using namespace std;
int main()
{
//fill your code here.
return 0;
}

 

TicketBooking.cpp

#include<iostream>
#include<string>
using namespace std;
class TicketBooking
{
//fill your code here
};
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY