Course Work
Aim
|
To develop skills on solving engineering problems using Object Oriented programming concepts.
|
Learning Outcomes
|
After completing this module the students will be able to develop and test complete object oriented applications and to refactor existing applications.
|
Task(s)
A Games App is required which features a game with a number of levels; on successful completion of a level, a player moves to the next level. You are being asked to develop a prototype of the part of the app which tracks player performance. Players can register directly with the app itselfor by supplying identification information from one of a number of linked social media apps.
Player data is stored in a single file; either delimited text format or object file. Player data is Id, Player Name, Image Filename, Current Level, Number of Attempts at Current Level, and, Overall Total Points Earned. Social media players will also store the social media app name and identifier.
Requirements
Develop a project with console menu-driven application. The project contains a controller class with stubs for methods implementing the required functionality listed below:
Load player performance information from a specified file into a players collection implemented using a repositoryAdd a new player with default values for current level, attempts and points.List all players in descending order of overall points earnedUpdate a player's performance data after an attempt at a level – overall points earned should be updated. On successful completion of a level the player should move to the next level and attempts returned to 0; otherwise, number of attempts should be incrementedPersist the collection to a specified file
The project should contain a model, repository and controller classes. A sample delimited text file is additionally supplied.
Development Approach
An incremental development approach should be used with the following increments:
Load players from a file and list in name order
This fulfils Requirement 1. To complete this increment you should:
Complete thePlayer, andSocialMediaPlayer classes with required fields and methods as depicted in the class diagram in Appendix 1.Decide on which type of collection you want the repository to define and make the necessary adjustments to theRepository class andRepositoryInterface.Partially complete theGameController class by completing the constructor method which creates a newRepository object from a file if specified by the userPartially complete theGameControllerclass to implement thelistPlayers() methodCreate aDAOImpl class to realize theDAOInterface using either text file or object file formatModify theRepository class to use theDAOImpl class to load players from a specified file
Document the results of your testing using screen snippets copied into a Word document. Take a copy of theGameController class and name it asGameController_Increment1.java.
Add new Player
This fulfils Requirement 2. To complete this increment you should:
Fully implement theaddPlayer() method in theGameController class; this should ask the user for required details, create a newPlayer orSocialMediaPlayer object and add it to theRepository object.
Document the results of your testing using screen snippets copied into a Word document. Take a copy of theGameController class and name it asGameController_Increment2.java.
List players in descending order of points earned
This fulfils Requirement 3. To complete this increment you should:
Complete thelistPlayersInPointsOrder() method in theGameController class.Ensure thePlayer class defines a method to compare players on thetotalPointsEarnedattribute.
Document the results of your testing using screen snippets copied into a Word document. Take a copy of theGameController class and name it asGameController_Increment3.java.
Update Player Performance Data
This fulfils Requirement 4. To complete this increment you should:
Complete theupdatePlayer() method in theGameController class. The number of points earned in this attempt should be entered and whether or not the level has been completed.
Document the results of your testing using screen snippets copied into a Word document. Take a copy of theGameController class and name it asGameController_Increment4.java.
Persist player collection to a file
This fulfils Requirement 5. To complete this increment you should:
Implement thestore() method of theDAOImpl class if you have not already done so.Implement anynecessarytoString(DELIMITER) methods.
Document the results of your testing using screen snippets copied into a Word document.
Marking Scheme
|
Marks
|
Player class
|
7
|
SocialMediaPlayer class
|
3
|
Repository class
|
4
|
DAOImpl class
|
5
|
Increment1 GameController class
|
7
|
Increment2 GameController class
|
5
|
Increment3 GameController class
|
5
|
Increment4 GameController class
|
5
|
Increment5 GameController class
|
4
|
Use of nested classes (inner/local/anonymous)
|
5
|
Use of abstract & generic classes
|
|
Use of lambda expressions
|
Total
|
50
|
Starter Project Test Run
run:
Game App
========
Players
=======
A. Add PlayerB. List PlayersC. Update PlayerQ. Quit
Enter choice:
A
Add Player
==========
Players
=======
A. Add PlayerB. List PlayersC. Update PlayerQ. Quit
Enter choice:
B
Players
=======
A. Add PlayerB. List PlayersC. Update PlayerQ. Quit
Enter choice:
C
Update Player
=============
Players
=======
A. Add PlayerB. List PlayersC. Update PlayerQ. Quit
Enter choice:
Q
Thank you for using Game App. Good bye.
Sample Delimited Text File
1,"Ahammed","pic1.jpg",19,2,1300
2,"Salim","sal.jpg",1,0,0,"MyBook","salin@sal.com"
3,"lal","lal.jpg",14,1,660