Project for Ruby- Theater seating

I need help…This is a project I have been trying to finish.

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

You asked us this at the beginning of the month and said it was due in a
day or two. The code you provided was from another user and it looks the
same? Did you manage to do anything else?

Oh and by the way I tried to run what you have so far and got an
unexpected
end error.

Am 28.10.2013 23:24, schrieb Kristina G.:

def initialize(selections)

puts “_”*75q

syntax error!

puts " “(5 + x%2) + seats[x].join(" ") + " "(11-x%2)+”|"
puts " “*75+”|"
end

You are stuck here in the middle of a method definition
-> another syntax error

‘def initialize’ without a class is a little unusual.

And you never use the method argument ‘selections’.

You can use “\u2b00” instead of [0x2b00].pack(“U”).

You should use variables for number of rows / seats per row
instead of hard coding the numbers into your program.

Frankly, considering you are working on this since a couple of
weeks ago, the result so far is a mess…
Before posting here you should at least try to run your code.

Regards,
Marcus

On Tue, Oct 29, 2013 at 9:49 AM, [email protected] wrote:

Frankly, considering you are working on this since a couple of
weeks ago, the result so far is a mess…

Also the deadline must have long since passed:

On Thu, Oct 3, 2013 at 2:07 AM, Kristina G. [email protected]
wrote:

I have 1 more day and we are moving to another language…

I agree to what has been said before: for someone who has learned C++
and Java Ruby should not be too far off the mark. After all concepts
of OO are the same regardless of language.

Cheers

robert

Thanks. Sorry. Wrong post. Already completed! But if someone post
something they need help not opinions.

On 29 October 2013 13:44, Sarah J. [email protected] wrote:

Thanks. Sorry. Wrong post. Already completed! But if someone post
something they need help not opinions.

Thats your opinion and you are welcome to it :slight_smile:

On 29.10.2013 14:44, Sarah J. wrote:

Thanks. Sorry. Wrong post. Already completed! But if someone post
something they need help not opinions.

Yes. And what constitutes “help” of course depends on the case at hand.

Kind regards

robert