2.5. Arcade (25%) You will also need to create a class to model an Arcade. This class should have fields for the arcade'

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

2.5. Arcade (25%) You will also need to create a class to model an Arcade. This class should have fields for the arcade'

Post by answerhappygod »

2 5 Arcade 25 You Will Also Need To Create A Class To Model An Arcade This Class Should Have Fields For The Arcade 1
2 5 Arcade 25 You Will Also Need To Create A Class To Model An Arcade This Class Should Have Fields For The Arcade 1 (158.79 KiB) Viewed 39 times
2.5. Arcade (25%) You will also need to create a class to model an Arcade. This class should have fields for the arcade's name, a field for the revenue of the arcade, a collection of the arcade games that it of- fers, and and a collection of the customers that are registered with the arcade. The class should have a single constructor that takes a single argument for the arcade's name, and there should be methods to add individual customers and arcade games (e.g. addCustomer (Customer c)). Further, it should have accessor methods for the arcade's name and the revenue of the arcade, in addition to a suitable toString and evidence of testing. . You should also provide methods for: getCustomer (String customerID) throws InvalidCustomerException getArcadeGame (String gameId) throws InvalidGameIDException Finally, you should also have processTransaction (String customerID, String gameID, boolean peak) method which will be used to process a transaction when given a customer ID, product ID, and boolean to represent whether the transaction was carried out during peak time. This method should tie together what you have already implemented - it should retrieve the correct game, the correct customer, and then try to reduce that customer's balance by the appropriate amount. If successful, this amount should be added to the arcade's revenue amount and you should return true to indicate that the transaction was a success. Otherwise, the method should throw an appropriate exception for why the transaction not be successfully processed.

Additionally, ArcadeCorp has asked that you provide the following methods: • findRichestCustomer () which should search the customers that are registered at a specific arcade to return customer with the highest balance; 7 getMedianGamePrice () which will consider the price per game for all arcade games within this arcade and return the median (if there is an even number of games then this method should average the price of the two middle games); • countArcade Games () which should return an int[] of size 3, where the first element is the number of cabinet games in this arcade, the second is the number of active games in this arcade (not including virtual reality games), and the third is the number of virtual reality games in this arcade; • printCorporate Jargon() which should be a static method in the Arcade class that prints a message and does not return anything. It should simply print the corporate motto of "GreedyJayInc. and ArcadeCorp do not take responsibility for any accidents or fits of rage that occur on the premises". It is up to you to decide how you wish to store collections of products and customers. The simplest solution is to use arrays/ArrayList, but you can use any data structure that is im- plemented in Java (such as those that extend the Java Collection class or similar). A small number of additional marks will be awarded for using a more appropriate data structure than array-based collections, but only if the data structure used is indeed more appropriate and the choice of data structure is justified in the code with a short comment (i.e. why exactly is the data structure that you are using a better choice than an array ArrayList). To be clear though, using an ArrayList or array will still lead to a good mark if implemented correctly.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply