Menu

[Solved]Write H File Inc Belowing Task Q37294882

Howshould i write the .h file inC++ for the belowing task?

Phase 1 The Reservation class, file I-O, array of objects, and calculations Implement a Reservation class that represents resDO NOT UPLOAD THIS DRIVER PROGRAM (main) TO PASS WThe amay of reservations and count of nesevationsin) ReservatleeazERes[50].Phase 1 The Reservation class, file I-O, array of objects, and calculations Implement a Reservation class that represents reservation entries like the contents in the file below: Sample input file (R1.txt/(Available at course web) Each line has 5 fields, separated by tab characters (t) 1830 1800 1900 1815 1845 1805 1850 1840 1820 1830 1910 Miss Au-Yeung Christine Wong Mr and Mrs Lam 51234567 2 Window side Name of contact person [assumed at most 20 characters ] Anthony Wong Mr Wong/ABC Co Wongs’ family Mr Simon Tang Irene Lam Michael J. Jackson 60111222 5 Near buffet food table Steve Paul Jobs Winnie the Pooh 6700 90123456 10 Quiet Time [int] Phone of contact person [int] Note [ assumed at most 40 characters ] 61234567 4 Near buffet 91992034 6 NIL 90120001 24 2 long tabl 95034500 2 NIL 60123123 8 NIL 90111333 8 NIL Count of guests [int) Kids utens Figure 1 800 Near dessert table The Reservation class should include the following private data members (1) time: int (2) name: a cstring with length-21 (3) phone number: int (4) num of guests: int (5) note: a cstring with length-41 (6) discount: a boolean value (true or false For each of (2) and (5) in the above, 1 extra space is counted for the nul character no). C) Refer to next paragraph for the rule of giving discount The reservations are for a dinner buffet that starts at 18:00. The full price is $500 per person. For first 5 reservations that comprises 4 or more guests, a discount of 20% will be given, ie, $400 per person. You are given a driver program (see P.2) that reads a text file as shown in Figure 1 and processes the data DO NOT UPLOAD THIS DRIVER PROGRAM (main) TO PASS WThe amay of reservations and count of nesevationsin) ReservatleeazERes[50]. //max 50 entres in the ธ1e eout << Thank you for using this program.ne Example 1 (Underlined contents are input by user) [A] Input r.ง.nationa fron file After main has called Type the pathrane of the irput tite: SAARIt read the discount is talse by default Disooant given for 5 reservation (s) mas mokes assignDiscounts to scan and update the records according to the rule given in P.1 IB) Display list of reservations 2: 10:0D- tel:612345671 Cheistine Mong : 19:0D-tei:512345671 Mr and Mrs 1a :28:15- tel:919920341 Anthony Wong 5: 18:4S-[tel:90120001] Me Wong ABC Co : 18:0s- (tel:91231234] Mongs’ family : 18:50-tel:950345001 ME Simen Tang 8: 18:40-te1: 601231231 Irene La 9: 18:20 teai: 60111222] Miehsai J. Jackson 24 $400 42 long tables) x5400 (Kids utensils 2) 2 $500 5阑3500 (Near buffet food table> 4 500 Near dessert table) The column’s width is 20 10::30-tel:901113331 teve Paut Jobe 1: 1910-l:67006800]snie the Pooh Thank you for using thia paogean Preas any kay te continue A solution: i the name is than 20 characters, add spaces to fill up. Then add one more Implement the Reservation dass (Reservation.h, Reservation.opp) based on the output and format in Example 1 Your Reservation h should contain at least the followings /The Reservatien Class W 14 add appropeiate constructoris) here and (10 Extraction and Insertion operators for the class Eriend estrean Soperater <c (ostrean soats, eonst Reseevatien srea) friend istrean Soperator >>a strean insReservation res) i W add private data members here (1) to (6-see page 1 (회 Ask fer the petname of an input file that eostains a list of reservation ontries. Read and count 0ern void readrileoReservations (Reservation arrRest].int sn): ” Assign discounts to reservations according to the restaurant’s rule void assignbiscounts (Reservation azrRes), int n) Show transcribed image text Phase 1 The Reservation class, file I-O, array of objects, and calculations Implement a Reservation class that represents reservation entries like the contents in the file below: Sample input file (R1.txt/(Available at course web) Each line has 5 fields, separated by tab characters (t) 1830 1800 1900 1815 1845 1805 1850 1840 1820 1830 1910 Miss Au-Yeung Christine Wong Mr and Mrs Lam 51234567 2 Window side Name of contact person [assumed at most 20 characters ] Anthony Wong Mr Wong/ABC Co Wongs’ family Mr Simon Tang Irene Lam Michael J. Jackson 60111222 5 Near buffet food table Steve Paul Jobs Winnie the Pooh 6700 90123456 10 Quiet Time [int] Phone of contact person [int] Note [ assumed at most 40 characters ] 61234567 4 Near buffet 91992034 6 NIL 90120001 24 2 long tabl 95034500 2 NIL 60123123 8 NIL 90111333 8 NIL Count of guests [int) Kids utens Figure 1 800 Near dessert table The Reservation class should include the following private data members (1) time: int (2) name: a cstring with length-21 (3) phone number: int (4) num of guests: int (5) note: a cstring with length-41 (6) discount: a boolean value (true or false For each of (2) and (5) in the above, 1 extra space is counted for the nul character no). C) Refer to next paragraph for the rule of giving discount The reservations are for a dinner buffet that starts at 18:00. The full price is $500 per person. For first 5 reservations that comprises 4 or more guests, a discount of 20% will be given, ie, $400 per person. You are given a driver program (see P.2) that reads a text file as shown in Figure 1 and processes the data
DO NOT UPLOAD THIS DRIVER PROGRAM (main) TO PASS WThe amay of reservations and count of nesevationsin) ReservatleeazERes[50]. //max 50 entres in the ธ1e eout a strean insReservation res) i W add private data members here (1) to (6-see page 1 (회 Ask fer the petname of an input file that eostains a list of reservation ontries. Read and count 0ern void readrileoReservations (Reservation arrRest].int sn): ” Assign discounts to reservations according to the restaurant’s rule void assignbiscounts (Reservation azrRes), int n)

Expert Answer


Answer to How should i write the .h file inC++ for the belowing task?… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *