Produce a BlueJ project implementing a version of STARS by completing tasks described below. Your project must be capable of running correctly on the software used in UH labs.
Your STARS project should display the qualities associated with good program design:
·Your system should minimise code duplication and be modularised so that components have low coupling and high cohesion..
·You should aim to make your code reusable and easy to maintain.
·Program code should be well documented, displaying both agreed standards of internal documentation.
·Marks shown for each task include marks for both functionality and design.
·Your project must compile. Code which does not compile may be included as comments
·You must attend the online timed demo session. If you do not do the demo session, you get ZERO marks.
Assignment Tasks - Marks awarded for tasks below total 100.
Task 1 - Implement and test the Card class 20 marks
·class Card should have:
·the fields described above
·a constructor to set fields values, using parameter values if required
·accessors to return the rating and the number of credits, at least
·methods to add or deduct credits, and to covert loyalty points to credits
·also methods which return a boolean saying whether
there are enough credits to make a shuttle journey
A parameter is the same as the card id
·a toString() method returning a String with all relevant information about the card
·class CardTester
·which will have a main() in which you will
ocreate a few Card objects
oand call their methods
oto show that they work properly
·NOTE: there is no need for any user input or menus or functions, Just a simple sequential tests as shown in L15 & L16 for the Dispenser and the StockItem classes
Task 2 - Implementing other lower level classes 25 marks
There is NO need to write tester classes for these class, but you could try to Bench Test them
·class World should have
·the fields described above. (But just start with the basic fields and add the collection later)
·a constructor to create a world with suitable parameters
·an accessor to return its rating
·an ArrayList field to store Card object references.. (declared and created)
·mutators enter() and leave() which have a Card as a parameter and add/delete is from the ArrayList
·an accessor which either says whether the world is full (reached capacity) (or still has capacity)
·a method to list all the Cards currently on the world
·an accessor which returns a boolean saying whether a card is on the world (in the ArrayList)
·a toString () method
·This is a basic list and you may need to add some more if required
·Shuttle should include:
·suitable fields as specified above.
·a suitable range of accessors/mutators to process data held by the class
·method which returns a boolean saying whether Card passed as a parameter can travel on the shuttle
·a method to process a card travelling to the destination world;
If the card meets the conditions make suitable deductions/additions to the card, add it to the destination world and delete from the source world, and return a suitable message
If it does not meet one of the conditions, return a suitable message and do NOT move it
·a method toString()which returns a String representation of an object of that class.
VERY IMPORTANT NOTE: these lower level classes should NOT be using System.out.println()
Without these classes you will find it difficult to develop the remaining classes. Yout may add further fields/methods as to these classes if you require them during further developmen development progresses
Task 3 - Implementing the top controlling class 20 marks
·class ResortManager
This is the class which provides all of the basic functionality.
·You are expected to provide fields and the code for the methods listed.
·You must NOT change the signatures of the methods listed - you will be penalised
·You may add methods but these must have the modifier private, so
· cannot be used in client classes
·Most of the methods in this class should they call the methods in the on objects of the lower classes
·Your methods should NOT deal with any input/output
This class should have the following fields:
·the name of a location
·collection of all cards, all worlds and all shuttles
·The collection of all worlds should be an Arraylist where the position of the world in the ArrayList is the same as its number i.e. “Home” should be at ArrayList location 0.
The constructor should
·set the location of the resort from a parameter value
·then call the three private methods defined at the end of the class to implement the Wayward Resort described in Appendix A (below)
·loadCards - should create all cards and add them to their collection
·loadWorlds - should create all the worlds in and add them to the collection of all worlds. These should be added in the order of their numbers
·setUpShuttles – should create all shuttles and add them to their collection
·Finally, the constructor should add all of the cards to the “Home” world
·[3 private methods to return each type of object (shuttle, card, world) using its key may be useful]
·The largest portion of marks in this task are for the methods: canTravel() and travel()
Task 4 - Implementing an application 8 marks
·class ResortUI - this is the class which provides an application for the user
·only this class and the Tester in Task 5 should use System.out.println
·this is the only class which has input
·some of the code has been written for you
·you should provide the remaining code
·However, only option 1 - 6 are required for the demo
·The remaining options are related to Task 6 which provide some challenges for those who want to get really high marks. If you have not completed Tasks 1 - 6, to a reasonable level, your attempts to so Task 7 will not be accepted
Task 5 - System Testing 12 marks
You can test your code by running the ResortUI but you will eventually find this tedious. So:
·Provide a Tester class which declares a variable of class ResortManager. to represent the Wayward Asteroids resort.
·Your Tester class must contain a doTest() method which calls appropriate methods on the ResortManager variable in a way which tests this class and demonstrates that it works according to specification. This method should include appropriate output to the terminal window. Use comments to explain what is being tested.
·Other than Tester and the CardTester in Task 1, you should NOT write testers for the other classes
·The class should have a main() to make it runnable but need not use functions
Marks for this task will be awarded for:
·the appropriate choice of data,
·the sequencing of method calls
·explanations of tests.
We are looking for evidence of a systematic approach to testing and will expect you to show that you have identified and tested for the main events likely to occur when the system is running. At this stage, you may ignore the situation where a card visits a world but has insufficient credits to return to the "Home" world.
Task 6 - System Documentation 5 marks
You should produce:
·a visually neat and readable UML-style class diagram of your system in BlueJ
·program code should be well documented, displaying both agreed standards of internal documentation and good use of the facilities available in Javadoc. No need for detailed comments on internal method code (ResortManager is already well documented)
Task 7 – Additional Functionality - Challenge tasks 10 marks
These tasks are designed to provide additional challenge. You will only get marks for this task if you complete tasks - 5 to a reasonable level and a specific task at the demo
·Add the following methods to the ResortManager class.
·topUpCredits – to add credits to a specified card
·moveHome - to move a card directly to the Home world without using shuttles or losing credits
·convertPoints - to convert a card's loyalty points to credits
·evacuateAll- to move all cards back to the Home world
·Add code in the ResortUI class to implement menu options 7 – 9
Task 8 - Demonstration 20 marks
At a designated time AFTER the designated assignment hand-in ( to be announced) , you will be asked to demonstrate that you have a good working knowledge of the code that you submitted. This will require you to have remote access to Studynet and BlueJ at a specified time. You will be asked to download your assignment and a written demo specification. In a timed window of 1 hour, you will be asked to make the specified changes and upload your amended code to the Demo assignment slot.
The main purpose of the demonstration is to authenticate your code by showing that you know it well enough to use it and make these changes. If you do not undertake this demonstration , your assignment will get ZERO marks.