StructArray C++

Create two structures named package and roomType. The first structure named package contains the members: numRoom, numNight while the structure roomType contains the members: type,breakfast,price and package (nested struct). Write a program that does the following:

a. Declare an array of structure of size 4 that can store the information of 4 room reservations.
b. A function that passes the structure as an argument and accepts information about the room through user input.
c.A function that sorts the information about the room in ascending order based on price.
d. A function that writes the information about the room reservation into a text file (*.txt)

Sample output:
Enter type of room: Deluxe
Specify if breakfast included: Yes
Enter price of room/night: 240
Enter num of room: 2
Enter num of nights: 4

Enter type of room: Family
Specify if breakfast included: No
Enter price of room/night: 350
Enter num of room: 1
Enter num of nights: 2

Enter type of room: Single
Specify if breakfast included: Yes
Enter price of room/night: 180
Enter num of room: 2
Enter num of nights: 3

Enter type of room: Suite
Specify if breakfast included: Yes
Enter price of room/night: 450
Enter num of room: 1
Enter num of nights: 3

Room Type Breakfast? Price/night Room Nights
——— —- —– —- —-
Single Yes 180 2 3
Deluxe Yes 240 2 4
Family No 350 1 2
Suite Yes 450 1 3

×
New Download