Recent Question/Assignment

ITECH1000 Programming 1 1627
Assignment 2 – VERSION 2
Overview
This is an individual assignment that requires you to design, develop and test a small Java program using object-oriented approaches.
Timelines and Expectations
Percentage Value of Task: 20%
Due: 16:00 Friday - Week 11 Minimum time expectation: 20 hours
Learning Outcomes Assessed
The following course learning outcomes are assessed by completing this assessment:
• Identify and use the correct syntax of a common programming language
• Recall and use typical programming constructs to design and implement simple software solutions
• Reproduce and adapt commonly used basic algorithms
• Utilise pseudocode and/or algorithms as a major program design technique
• Write and implement a solution algorithm using basic programming constructs
• Demonstrate debugging and testing skills whilst writing code
• Develop self-reliance and judgement in adapting algorithms to diverse contexts
• Design and write program solutions to identified problems using accepted design constructs
ITECH1000 Programming 1 1627
Assessment Details
It’s time to do battle!! Your task is to design, develop and test a basic Pokémon battle ground using the following class diagrams and screen shots.
Stage 1: Design
This stage requires you to prepare documentation that describes the function of the program and how it is to be tested. There is no coding or code testing involved in this stage. A document template has been provided for your use.
Requirements:
1) Read through Stage 2: Program Development to obtain details of the requirements of this program.
2) Write an algorithm that describes how the program will operate.
a. All program requirements must be included, even if you do not end up including all these requirements in your program code.
b. The algorithm must be structured logically so that the program would function correctly.
3) Prepare and document test cases that can be used to check that the program works correctly, once it has been coded. You do NOT need to actually run the test cases in this stage; this will occur in Stage 3: Testing.
a. All program requirements must be included, even if you do not end up including all these requirements in your program code.
b. Make sure the test cases include checking of data entered by the user to make sure that only valid data is accepted. If the user enters invalid data, the user should be informed of this and given another chance to enter the data. NB: As we have not covered exception handling, you may assume that the user will always enter the expected data type.
c. Test cases should be documented using a template like the one below. You may include extra information if you wish. At this stage, the Actual Result column will be left blank.
Test Case Expected Result Actual Result
The user opts to view gym memberships User is asked to select a Pokémon gym.
Once gym is selected a list of members and their Pokémon are displayed to the user
Stage 2: Program Development
Using the Design Documentation to assist you, develop a Java program that uses object-oriented coding approaches to implement the requirements outlined in this section.
You must follow coding conventions, such as proper layout of code, using naming conventions and writing meaningful comments throughout your program.
Overview of the Program:
This section provides an overview of how the program works from the user’s perspective. You may change the appearance of the program provided you implement the same functionality.
1. When the program starts, it provides a short welcome message, and then automatically initialises the program. This initialisation includes creating the Pokémon gyms, Pokémon and members.
2. When initialisation is complete, a menu appears providing the user with options to battle Pokémon, view gym membership, view the highest winner at a gym, view the highest winner across all of the gyms and to exit the program.
3. When the user selects the Battle Pokémon option, a second menu appears from which the user can select a Pokémon Gym.
a. Upon selecting any of the gyms, the user is told of the first challenger and the second challenger and who wins the battle.
b. The user is returned to the main menu
4. When the user selects the View Gym Membership option, a second menu appears from which the user can select a Pokémon Gym
a. Upon selecting any of the gyms, the user is shown a list of members, their details and associated Pokémon
b. The user is returned to the main menu
5. When the user selects View Highest Winner at a Gym option, a second menu appears from which the user can select a Pokémon Gym
a. Upon selecting any of the gyms, the user is shown the details of the member who has had the most Pokémon battle wins.
b. The user is returned to the main menu
6. When the user selects View Highest Winner across Gyms option, the winners for each gym are displayed, along with the overall winner.
7. When the user selects the option to exit the program, a message thanks the user for using the system, the author of the program is shown and the program terminates.

Technical Information:
This section provides technical implementation details required by the programmer to create the program.
Development of this program requires four classes: PokemonGym, Member, Collection and Pokemon as well as a Driver class to control the flow of the program. Use the class diagram and hints below as the basis for designing your classes.
PokemonGym Class: This represents a Pokémon Gym. A Gym is made up of two members for this assignment.
HINTS:
getHighestWinner(): Member method returns the member who has had the most number of wins at the Pokémon Gym printoutHighestWins() method prints to the screen the details of the member who has had the most number of wins at the Pokémon Gym
printoutMembership() method prints to the screen ALL the details of the members registered with the Pokémon Gym addMember(): Member method checks to see if the member has already been added and if there are any spaces left at the Gym. If the member hasn’t been registered at the Gym before AND there are spaces left the member is added to the member list.
pokemonBattle() method prints to the screen the outcome
of a Pokémon battle. A battle is between the two members of a Gym (also known as challenger 1 and challenger 2). To win, a randomly selected Pokémon from each challenger ‘battles’. The winner is the member whose randomly selected Pokémon has the greatest strength. The member who wins the Pokémon battle is displayed and their number of wins is increased by one (1). If both randomly selected Pokémon have the same strength level, then both members get one (1) point.
Member Class: This represents a single member (e.g. a person). Each member has a collection of Pokémon. The size of the collection is dependent on the age of the member HINTS:
setCollectionSize() method sets the size of the
pokemonCollection variable. If the member who is registering is above the age of 13, then they get a collection size of 4 (e.g. they can collect a maximum of 4 Pokémon). If they are 13 or younger they get a collection size of 2.
addNewPokemon(Pokemon) method calls the pokemonCollection addNewPokemon(Pokemon, String) method (passing an instance of Pokémon and the members name)
updateBattleOutcome(boolean) method is used to update the numberWon variable when a member wins a ‘battle’ printMe() method prints to the screen all of the details of the member, including their Pokémon.
Collection Class: This represents a collection of Pokémon. A collection belongs to a member and is made up of Pokemon. The size of the collection is based on the age of the member (see above).
HINTS:
maxSizeOfCollection(): int method returns the size of the collection.
addNewPokemon(Pokemon, String) method checks to see if there are any spaces left in the collection. If there is it then checks to see if the Pokémon has already been added to the members’ collection. If it hasn’t then it is added to the collection. Error messages are displayed to the user if there is no room left in the collection or if the Pokémon has already been added.
numberOfPokemon(): int method returns the number of Pokémon currently held in the collection (not the collection size). getRandomPokemon(): Pokemon method returns a random Pokémon from the collection. printMe() method prints to the screen all of the details of the Pokémon held in the collection
Pokemon Class: This represents a single Pokemon. A Pokemon is stored in a Collection HINTS:
A random number is generated and assigned to the strengthLevel variable in the constructor. The random number generated needs to be between 0 and 200.
printMe() method prints to the screen all of the details of the a Pokémon.
Driver Class: Name this file using ID Your Student ID . This will contain a main() method to manage the flow of the program, and other methods as necessary to ensure the code is modularized and functions correctly. It should include the following functionality
Initialising the Program:
Initialising the program requires the following steps:
1. Create a new PokemonGym for each of the three gyms. The following attributes must be set when each Pokémon Gym is created:
Gym Name Gym Location
Pewter City Gym Kanto Region
Vermilion City Gym Celadon City
Fuchsia City Gym Fuchsia City
2. Create at least 10 new Pokémon. Each Pokémon needs a name and a type (e.g. fire, water, bug).
3. Create 6 new instances of the Member class. Each member needs a name and an age.
You may choose the names for your own members but
a. One member MUST have your own name
b. You may not use the name of any other student enrolled in ITECH1000.
c. One member MUST be under aged 13 or under
4. Give each member up to four different Pokémon
a. When all places in the Collection have been filled, no further Pokémon may be accepted.
5. Add the members to a Pokémon Gym
6. The user should be advised with a message if the member can’t be added to the Gym or a Pokémon can’t be added to a member. Your initialisation code must include attempted ‘registrations’ that result in each of these issues.
7. Advise the user that initialisation is complete, Running the Program:
1. Battle Pokemon
a. When selected, a second menu should display asking the user to select a Gym.
b. Based on the user’s input, the two members of the selected Gym should ‘battle’. The winner(s) receive 1 point.
c. If the user selects an option that is not valid, then a message should be displayed and the menu shown again.
2. View Gym Membership
a. When selected, a second menu should display asking the user to select a Gym.
b. Based on the user’s input, the appropriate method created in the PokemonGym class should be run. Remember, the output requires reading information from the member array and presenting this information in a readable format.
c. If the user selects an option that is not valid, then a message should be displayed and the menu shown again.
3. View Highest Winner at a Gym
a. When selected, a second menu should display asking the user to select a gym.
b. Based on the user’s input, the appropriate method created in the PokemonGym class should be run. Remember, the output requires reading information from the member array and presenting this information in a readable format. If both members have the same number of wins, then it is okay just to show one winner. If neither members have any wins, an message should be displayed telling the user that the results are not available
c. If the user selects an option that is not valid, then a message should be displayed and the menu shown again.
4. View Highest Winner across Gyms
a. The report of all the highest winners for each of the three gyms should be displayed. A linear search should then be used to work out which member has the highest win score.
5. Exit Program
a. The program should exit by reaching the end of the main() method. System.exit(int) should not be used.
b. A message thanks the user for using the system, your details are shown and the program terminates
Stage 3: Testing
Using a copy of the test cases developed in Stage 1: Design, test the program you have developed in Stage 2: Program Development. Document your results, including both failed and successful tests.
Note: Please do not leave out any failed tests. If your testing highlights that your program has not worked correctly, then the failed tests help to demonstrate that you have been testing your program properly.
To show that you have tested your program, include small (but readable) screen captures in your Actual Results as well as any explanatory comments. Microsoft Windows includes a Snipping Tool that is useful for taking captures of the relevant parts of the screen.
Submission
Your program code, design and testing documentation should be zipped into a single file and loaded into the Assignment Box provided in Moodle by the due date and time.
Plagiarism:
Plagiarism is the presentation of the expressed thought or work of another person as though it is one's own without properly acknowledging that person. You must not allow other students to copy your work and must take care to safeguard against this happening. More information about the plagiarism policy and procedure for the university can be found at http://federation.edu.au/students/learning-andstudy/online-help-with/plagiarism.
Feedback
Assignments will be marked within 2 weeks of submission. Marks will be loaded in fdlGrades, and a completed marking sheet will be available via Moodle.
Marking Criteria/Rubric
Task Available
Marks Student Mark
Stage 1: Design Documentation
Development of an algorithm describing how the program should function
0.5
• All requirements from the Assessment Details section included
• Logical structure
Documented test cases to validate program
• All requirements from the Assessment Details section included
• Data is validated to ensure user entries are appropriate and incorrect user entries are handled smoothly
0.5
Stage 2: Program Development
Initialisation of the program:
• Creation of PokemonGym, Member, Collection and Pokemon classes as outlined in the assignment sheet
4
• Adding members to a Pokémon Gym, ensuring each member is only registered once in a Gym, a Pokemon is only registered once to a member and all limits are applied. 2
Running Program
• Appropriate menus display until user chooses to exit or return to previous menu
0.5
• Battle Pokemon runs as specified in the assignment sheet 2
• The View Gym Membership displays and is easy to read 1
• The Highest Winner at a Gym is found (given a selected gym) and the members details displayed clearly 1
• The Highest Winner across Gyms displays the highest winner from each Pokemon Gym and the overall winner 2
• The program exits successfully and details of program author are included 0.5
Coding Standards
• Code modularized, correctly using method calls and passing data between methods
1
• Object-oriented approaches have been implemented appropriately 1
• Use of coding conventions throughout entire program, including readable and clear layout, following naming conventions and including meaningful and appropriate comments. 1
• The Java program addresses the requirements outlined in the Assignment Details section, including appropriate use of classes, instances, loops, conditional statements, constants and variables: 1
Stage 3: Testing
Documented test results clearly showing all the testing that has been conducted and the results of this testing.
2
Total 20

Looking for answers ?