You're building a system to process orders for seats to an event
You have two input files
The first is sections.txt. It contains a list of sections of seats. Each section has a name, a number of available seats and a cost per seat. It looks like this
Upper 30 50 Balcony 20 100
Each component is separated by spaces. The first component is the name, the second is the total number of seats in the section and the last is the price per seat in the section. Each section is on a separate line.
The other file is orders.txt. It contains a list of orders. Each order has a customer name, a number of desired seats and a section name. It looks like this
Tom 5 Balcony Sarah 9 Balcony
Components separated the same as in sections. The first component is the customer's name, the second is the amount of seats the customer wants to buy and the third is the section that the customer wants to buy seats in.
- Your program should read the two files in and process each order.
- When an order is processed then the seats sold should be deducted from the remaining seats for that section
- If a customer wants to purchase more seats than are remaining in a section then the program should not process that order.
When the program is finished the output should be
- The count of remaining seats in each section
- The total money earned from sales