Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use C++ to write the codes. Thanks! Question 1 This question is based on contents covered in Chapter 10 of text. The objectives of

Please use C++ to write the codes. Thanks!

image text in transcribed

Question 1 This question is based on contents covered in Chapter 10 of text. The objectives of the . access if students have understood the basic concepts of object-oriented class write the class specification, constructor and methods write test driver to test the written methods . Examine the following class diagram, additional information and answer the following date: string llevent date in YYYYMMDD format event Type: char I-intermal, P public ticketClass: char I/S-standard, V-vip getEventN getDatc0:string isMember0:bool TICKETO Constructor with default values eventName "unknown" date "unknown eventType T ticketClass s' price -o; membertrue Assessor for data date and memberisMember returns true if member is true Prompt the user to enter the eventName, date, event Type, ticketClass, price and member, Only date in current year (2018) is valid. For publie events add S10 to price. VIP tickcts are three times the valuc of standard tickets (after adding $10 is sellTicketO:void on the final price. Calculate the price and store it in member variable price Uses cout to display the respective data members. If member is true, displays "This purchase is made by Member If member is faise, displays "This purchase is (a) Develop C++ code to implement the TICKET specification (b) Develop C+ code to implement ALL methods found in the TICKET class. (c) Write a function, displayMenu that display the following menu. Function signature: int displayMerue). The function accepts, validates the input and returns the valid choice to the ealling program ickets Sales System Display a11 tickets Display tickets sold to Menbers for a given Event name Display tickets in decending order of the event date nter choice to 5) (d) Write a test driver to test and fulfil at lcast the following requirements (i) (ii) Calls the function, displayMenel) in a loop and invokes the respective methods of iii) Option 1: invoke the mcthod, sellTicket ) and performs boundary check for the (iv) Option 2: uses a loop to invoke the display method ofarray of TV objeets Declares an array of 10 TICKET objects. TV class corresponding to the selected choice array of TICKET objects Option 3: inputs a eventName from user and traverses the array of TICKET objects to display the tickets of a event purchased by members. (v) (vi) Option 4: makes a copy of array of TICKET objects. Sorts the new array in descending order (reverse chronological order) of date. Uses a loop to invoke the display method of sorted array of TICKET objects. [Note:- Write you own sorting algorithm instead of using functions like std:sorto]. (vii) Option S: displays the message,"Thank you for using the program..." and exit the Include a screen output in your submission. (15 marks)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions