Netbeans Project Implemented CODE: Assignment

Added on - 18 Sep 2019

Trusted by 2+ million users,
1000+ happy students everyday
Showing pages 1 to 3 of 7 pages
6COM1037 OO developmentCoursework 1Nov 2016Champions of Disc Earth - CODE1.The AssignmentProduce a Netbeans project implementing the specified version of CODE by completing tasks described below. Yourproject must be capable of running correctly using the software in UH labs.Your CODE project should display the qualities associated with good program design. Your program code should:minimise code duplication and be modularised so that components have low coupling and high cohesion.use inheritance, abstract classes and interfaces, as reusable and easy to well documented, displaying both agreed standards of internal documentation and good use of the facilitiesavailable inJavadoc.The project you submit must compile.If your project does not compile, you will not be able to perform in thedemo. You must attend the demonstration session.If you do not attend your designated demonstration session,you will get ZERO marksThe projectoodcwk-studentscontainstheCODEinterface, aPlayerclass, aGameUIclass to help withtesting, someenumclasses,MyTesterwhich can also be used for testing and aTeamworkclass.GameIOcompiles, but will only provide results when you have implemented appropriate methods inPlayerand loaded somedata.You should not change the code provided (except as instructed).2.Pair ProgrammingComplete this assignment by working in pairs. Submissions by single students, or larger groups will not be accepted.For pair programming to be successful, members of a pair must be able to work together, at the same computer, forsuitably long periods of time. You should also vary who actually types in the code and who is observing/advising. Thistechnique works best if the skill levels of the pair are roughly equivalent. If there is a wide disparity between skill levelsthere is a high probability that the weaker of the pair will not learn anything, while the stronger will do all of the work.This will not prepare the weaker partner for the tasks in the demo session, or for future assessments.Before you start of the assignment please edit theTeamworkclass by replacing the Strings in the array withdetails appropriate for your pair.If you complete this incorrectly, you may receive ZERO marks.You must EACH submit the same project to Studynet by the deadline.Tasks in the demo session must be completed individually.3.Test First DevelopmentThe code in this project is complicated to mark by inspection, so its functionality will be marked professionally byrunning testing software. This software will be testing your implementation of theGameinterface. However, inorder to implement the interface in line with OO design principles, you should add some lower level supplier classes. Ifyou try to just write everything inPlayer,the code will be horrendously complex and totally unmaintainable (and notget good marks for design).Since you don’t yet know how to do professional testing, you have been given a tester classMyTesterand a text filewith the expected results of all tests. This tester class does not need to know anything about your implementation as itis written to theGameinterface. The software which we will use to test your code (and award marks) will perform thesimilar tests, but use different data. When you have implemented some method in the interface, you would be wise totest it using appropriate tests inMyTesterto see whether it gives the same results. The essence of “test firstdevelopment” is that you write code to produce the expected results - so you should at least look at them.You have also been given a user interface classGameUI,which you can use to test your code with keyboard input.However, there is no point in testing if you don’t know the expected results. So you should useMyTesterto see whatresults are to be expected from the given test data.NOTE: tests inMyTesterare designed to be as independent as possible so that they don’t contaminate each other.EachMyTestertest starts by creating a fresh newPlayerobject which is not contaminated by the results of anyPage1
6COM1037 OO developmentCoursework 1Nov 2016previous tests. If you want to get similar results usingGameUI,you must to “quit” and restartGameUIfor eachtest.Page2
6COM1037 OO developmentCoursework 1Nov 20164.Game Description“Champions of Disc Earth” (CODE) is a strategy game. The current prototype provides a very simplified version of thegame for one player. Here is the briefing provided for a player of this version of the game: You are the ruler of DiscEarth. Your kingdom is assaulted by a variety of enemies who provide different types of challenges. To protect yourkingdom, you must assemble an army of champions who can meet (and hopefully win) these challenges from yourenemies. The game provides a collection of champions whom you can hire.At the start of the game you have a fixed amount of money (1000 gulden) in your treasury which can be used to hirechampions. To add a champion to your army, you have to use the money in your treasury to pay their hire fee. Onceyou have an army, you will be expected to meet some challenges. Winning a challenge will bring you rewards, andincrease your treasury. If you lose a challenge, you have to pay the reward money to your enemy and lose it from yourtreasury. At any point in the game, you can hire or discharge champions. If you discharge a champion, you can getthem to pay you back half of their hire fee. So when you need money, you can discharge champions if they are in yourarmy, but not if they are dead or already available for hire. The skill in this version is in assembling your army in a waywhich enables you to win challenges and increase your treasury.Your enemies offer different types of challenges. Each challenge has a unique number, the name of the enemy, a type(Magic, Fight or Mystery), a required skill level, and a reward. In this game prototype, you will need to select achallenge by number (later versions will select challenges for you at random). Your game should then choose the firstavailable champion in your army who can meet the challenge and compare the skill levels. The results of meeting achallenge will be one of the following:“Challenge won by...“ – add reward to treasury, return name of champion“Challenge lost as no suitable champion available” – deduct reward from treasury“Challenge lost on skill level” - deduct reward from treasury and set your champion to "dead"Champions can be one of the following types: Wizard, Warrior or Dragon (more types to be added later). The tablebelow shows which type of challenge they can meet:MagicFightMysteryWizardyesyesyesWarriornoyesnoDragonnoyesOnly if they talkEach champion has a unique name, a skill level, a hire fee. Wizards have a hire fee of 300 gulden, but if they are alsonecromancers their fee is 400 gulden. They also have a speciality. Warriors set their own hire fee, and you also need tostore their preferred weapon. Dragons have a fixed hire fee of 500 gulden, and some of them can talk. Each championhas a skill level recorded as a number from 1 to 10. All dragons have a skill level of 7. A warrior's skill level is their hirefee divided by 100(ignoring remainders). Wizards have different skill levels. See Appendix A for sample data.Champions are in one of the following states:for hire – is in the game’s collection of champions but not yet hired for your armyactive – has been hired for your army and is available to meet challengesdead – is not available for challenges, cannot be restoredChallenge numbers should be sequential from 1. Challenges can be met more than onceAfter losing a challenge, your treasury may be <0. You cannot buy any more champions. However, you can continue tomeet challenges with your remaining champions in the hope of winning some more money (even if your treasury goesfurther into debt). You may also make money by discharging champions. However, if your treasury has no money or isin debt, and you have no champions to discharge, then you have lost the game and a suitable message should beoutput.5.ScopeThis early working version of the game requires the player to select the challenge (by number). This has been done tomake it possible to design a standard set of tests. Programs with "random" features are difficult to test because of theirunpredictability. Once the game is fully tested, a “random” element can be introduced. You are NOT required to do this.In future, the condition for "winning" the game will be to meet all the challenges and still have money left in the treasury.You are NOT required to implement this feature of the game.In future, when a player has lost, the game will automatically terminate after displaying an appropriate message. Youare NOT required to ensure the game terminates, but will be expected to display a suitable message.Page3
Desklib Logo
You are reading a preview
Upload your documents to download or

Become a Desklib member to get access