A ticket at a ticket selling booth at a fair is priced at Rs.2.50/-. The booth keeps track of the total number of people who have visited the booth, the number of people who have actually purchased a ticket and the total amount of money collected. Design a class called Ticbooth which includes the following Members: Class name Ticbooth Data members no_people number of people who have visited the booth. amount total amount of money collected. Member functions void initial() To assign initial values to data members. void notsold() Increment total number of people only visiting the booth and not purchasing a ticket. void sold() Increment total number of people purchasing a ticket and the amount collected when a ticket is sold. void disp_totals() To display the total number of people visiting the booth (the total number of people purchasing the ticket as well as those not purchasing a ticket). void disp_ticket() To display the total number of tickets sold and the amount collected. Specify the class Ticbooth giving details of the functions void initial(), void sold(), void notsold(), void disp_totals() and void disp_ticket(). The main function needs to be written. |
|
asked by Anugrahkapoor24 (anugrahkapoor24) 5 years ago | |
0 |
Other Questions on This Topic
I miss the old res papers and the friends you could make here. |
|
asked by Joseph Chennattu (joseph444) 7 days ago | |
2 |
What is the difference between steam turbines and gas turbines? |
|
asked by Yogesh (yogesh) 23 days ago | |
1 | |