I need help...This is a project I have been trying to finish ASAP Write a progra
ID: 3545207 • Letter: I
Question
I need help...This is a project I have been trying to finish ASAP
Write a program that can be used by a small theater to sell tickets.
The theater auditorium has 15 row of seats with 30 seats in each row.
The program should display a screen that show which seats are available
and which are taken.
Seats taken use *, seats available use #
When a program begins it should ask the user to enter the seat price for
each row. The prices can be stored in a separate array.(alternatively
the price can read from a file.)
Once price entered the program should display a seating chart. The user
may enter the row and seat number for tickets being sold. Every time a
tickets or group of tickets is purchased the program should display the
total ticket prices and update the seating chart.
The program should keep a total of all ticket sales. The user should be
given an option of viewing this amount.
The program should give the user an option to see a list of how many
seats have been sold, how many available in each row, and how many seats
are available in the entire auditorium.
input validation when tickets are being sold, do not accept row or seat
numbers that do not exist. When someone request a particular seat the
program should make sure seat is available before it is sold.
This is what I have so far...
def initialize(selections)
puts "_"*75q
3.times{puts " "*75+"|"}
puts " "*68+"EXIT"+[0x2b00].pack("U")
puts " "*76+"/"
puts " "*75+"/"
3.times{puts " "*75+"|"}
seats = (0...15).map{Array.new(30,"#")}
seats[5][2] = "*" # sample input
seats[6][3] = "*" # sample input
seats.each_index do |x|
puts " "*(5 + x%2) + seats[x].join(" ") + " "*(11-x%2)+"|"
puts " "*75+"|"
end