My program uses a 2D array(15x20) to simulate a theater and asks the user which seat they wish to buy. '*' denotes empty seat and '#' denotes taken seat. The prices vary by each row and the prices come from an input file. When the user quits the program, it tallies the total sales from the tickets and i don't know how to do that.
prices from input file: $10(rows 0 - 4), $9(row 5 - 9), and $8(rows 10 - 14)
When the user quits the program, it tallies the total sales from the tickets and i don't know how to do that
You need to keep a running tally of the price of the seats sold.
When you sell a seat, figure out the price of that seat, then add the price of the seat to the running tally. At the end of the program, simply display the running tally.
BTW, line 128 you never close the file. This is a resource leak.