none
CSV RRS feed

  • Question

  • You cannot vote on your own post                            
    0
                    

    Hello,

    I need to create code for a system used for booking seats in a cinema that will check for a continuous block of seats on any row so that a group of people can sit together.

    Here is an example of a small block of seats with 5 rows, labelled A to E, with 10 seats per row numbered 1–10.

    E1

    E2

    E3

    E4

    E5

    E6

    E7

    E8

    E9

    E10

    D1

    D2

    D3

    D4

    D5

    D6

    D7

    D8

    D9

    D10

    C1

    C2

    C3

    C4

    C5

    C6

    C7

    C8

    C9

    C10

    B1

    B2

    B3

    B4

    B5

    B6

    B7

    B8

    B9

    B10

    A1

    A2

    A3

    A4

    A5

    A6

    A7

    A8

    A9

    A10

    I need to create code that will allow me to search through the available seats to locate a block of seats in a specified row for groups of up to 6 people.

    The input will be:

    The number of people in the group (maximum is 6)

    The desired row.

    The output should:

    Confirm if there is a block of seats available in the chosen row.

    The corresponding seat numbers in the format :

    availability, number of seats, seat number - seat number (eg. "Seats available for 5 people B2 - B6")

    Or should output a message that indicates that there is no block of that size available.

    I need help to solve this tasks - examples of code will be helpful.

    Thanks in advance.

    Monday, March 17, 2014 8:07 PM

Answers

  • Hi Jopo!

    You already asked this question on another thread and GoTo loop gave you lots of help. Re-posting won't help. Can you please tell us what you don't understand so we can help you understand instead of simply asking for code? 


    Please mark any answers and "vote as helpful" any posts that help you!

    Monday, March 17, 2014 8:32 PM
    Answerer

All replies