Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Introducing...
- The ########################################################
- #
- # #### # # ### # # ##### # # #### ##### #
- # # # # # # # # # ## # # # #
- # # ##### # # # # ### # # # # ## ### #
- # # # # ##### # # # # ## # # # #
- # #### # # # # ##### ##### ##### # # ### ##### #
- # #
- #############################################################
- ##CHANGELOG:
- C 03|11|11 Created.
- U 04|11|11 Added hint #1
- U 06|11|11 Added outline of algorithm
- U 08|11|11 Added test class for algorithms
- ##THE GOAL:
- To solve the following tasks. To encourage discussion of how
- programming can be done in different ways.
- ##THE BACKGROUND:
- Imagine you are developing a system for booking seats in a
- cinema. The system has a GUI where you can click a seat and
- the amount of seats you have specified are automatically
- selected around this seat.
- When you enter the selection screen a suggestion is
- automatically made: The specified amount of seats, next to
- each other, closest to the middle of the screen.
- ##THE TASKS:
- 1) Describe the algorithm that automatically selects a
- suggestion for any amount of seats.
- 2) Describe the algorithm that selects seats closest to where
- a seat is clicked.
- 3) Which parts of these algorithms are alike?
- 4) Write your algorithm in Java. Remember to explain what your algorithm is intended to do - how does it find the seats?
- ##HINTS:
- 1) Here is a link to an Algorithm interface. Implement this in your interface when writing it, so that it can be run with a GUI. -> http://pastebin.com/UiibqMZH
- 2) An outline of an algorithm can be found here: -> http://pastebin.com/kkirFbp1 - don't call it BookFartAlgorithm, though. That's just silly. And besides, that's what my algorithm is called...
- 3) Added Seat.java and AlgorithmTest.java that you can compile and run (along with your algorithm; read the source and replace my algorithm's name with yours) to test your algorithm. It prints all the seats and then the seats you have selected. Found here: Seat.java: http://pastebin.com/5uLW59c4; AlgorithmTest.java: http://pastebin.com/kZh84XSm
- ##THE PRIZES:
- Honor and glory.
Advertisement
Add Comment
Please, Sign In to add comment