hypesystem

[CHALLENGE] C1: Cinema algorithms

Nov 3rd, 2011
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. Introducing...
  2. The ########################################################
  3. #
  4. # #### # # ### # # ##### # # #### ##### #
  5. # # # # # # # # # ## # # # #
  6. # # ##### # # # # ### # # # # ## ### #
  7. # # # # ##### # # # # ## # # # #
  8. # #### # # # # ##### ##### ##### # # ### ##### #
  9. # #
  10. #############################################################
  11.  
  12. ##CHANGELOG:
  13. C 03|11|11 Created.
  14. U 04|11|11 Added hint #1
  15. U 06|11|11 Added outline of algorithm
  16. U 08|11|11 Added test class for algorithms
  17.  
  18. ##THE GOAL:
  19. To solve the following tasks. To encourage discussion of how
  20. programming can be done in different ways.
  21.  
  22. ##THE BACKGROUND:
  23. Imagine you are developing a system for booking seats in a
  24. cinema. The system has a GUI where you can click a seat and
  25. the amount of seats you have specified are automatically
  26. selected around this seat.
  27. When you enter the selection screen a suggestion is
  28. automatically made: The specified amount of seats, next to
  29. each other, closest to the middle of the screen.
  30.  
  31. ##THE TASKS:
  32. 1) Describe the algorithm that automatically selects a
  33. suggestion for any amount of seats.
  34. 2) Describe the algorithm that selects seats closest to where
  35. a seat is clicked.
  36. 3) Which parts of these algorithms are alike?
  37. 4) Write your algorithm in Java. Remember to explain what your algorithm is intended to do - how does it find the seats?
  38.  
  39. ##HINTS:
  40. 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
  41. 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...
  42. 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
  43.  
  44. ##THE PRIZES:
  45. Honor and glory.
Advertisement
Add Comment
Please, Sign In to add comment