- Case StudyHelp.com
- Sample Questions
700008 Programming Fundamentals and Computer Science Assessment 3 Solutions – WSU
Assessment Details:
- Topic: Programming Fundamentals
- Subject: Computer Science
- Deadline:*: As Per Required
Studying in Computer Science? Looking for 700008 Programming Fundamentals Assessment 3 Answers 2020? Get Assignment Answers on Programming Fundamentals Assessment 3 for Academic Grade in Australia, UK and USA. Case Study Help Online offers Programming Fundamentals Assignment, Computer Science Assignment Writing and Top Academic Writing Service for College & University Students. Get Free Quote with 24/7 Live Chat Support.
Applied Project
Assessment Weighting: 40%
Total Marks: 100
Learning outcomes addressed: 1, 2, 3, 4
Files required:
Download Cat Mouse Maze-initial from the Assessment 3: Applied Project folderonv UWS. This is the skeleton provided, which the students will use to type in the code.
Submission instructions: Make a zip file of your Greenfoot project file and upload that file via the submission link in the Assessments folder in vUWS.
Good coding practices
- Commenting and documentation
- Consistent indentation
- Code grouping
- Consistent naming scheme
- Avoid deep nesting
- Limit line length
- File and folder organization
Project details
In this assessment you will be writing code to develop interactive games for kids. Assume Walt Disney studio’s Mickey Mouse productions has identified you as a programmer for developing the game you designed in the last assessment. They want you to develop the game in Java for their next assignment. Specifically, you are tasked with programming the Cat Mouse Game in Green foot. On completing the coding, submit the Greenfoot project via a link in the Assessments folder on vUWS.
Download the CatMouseI Maze-initial scenario from vUWS to a “project” folder within the “700008” folder and extract it. In the CatMouse Game, the Cheeky Mouse in the Cheese World is on a mission to eatas much cheese as possible and go home safely. If the user can move the Cheeky Mouse home safely with curser keys, the user wins. The user can collect one cheese point for every piece of cheese eaten by the Cheeky Mouse. The CatMouse Game is to be played inrun mode (after clicking the Run button in the Greenfoot visual interface) in Greenfoot.
Currently, users can play the game in three modes: mode zero, mode one and mode two. The game mode specifies the different dangers that can appear on the Cheese World. Two types of danger objects that may appear in the Cheese World are Mouse Trap and Lazy Cat.
At the beginning of the game, the user should choose the mode. The world is prepared with the relevant objects as specified in Table 1.
If the user is playing in game mode one or two and the Cheeky Mouse is caught in the mousetrap or by the LazyCat, the user will lose the game.
Must Read: Software Engineering Programming Fundamentals Class
Mode | User choice | World preparation | |
Mode zero | 0 |
No danger objects appear in the world. |
|
Mode one | 1 | A Mouse object, Home object, Cheese objects, Barrel objects and 3 MouseTrap objects appear as given in Figure 2. CheekyMouse has to watch out for the MouseTraps in this mode. | |
Mode two | 2 | A Mouse object, home object, Cheese objects, Barrel objects and 2 MouseTrap objects and a LazyCat object appear as given in Figure 3. CheekyMouse has to watch out for the MouseTraps and the LazyCat in this mode. |
Task 1: Program CheeseWorld
Program CheeseWorld to add Barrel, Cheese, CheekyMouse, Home, LazyCat, MouseTrap objects as required.
Input validation: The only valid user choices are the values recorded in Table 1.
Notes:
- CheeseWorld is organised into an 8×8 grid cell. Each object appearing in the grid has a unique grid number and specific x coordinate and y coordinate value.
- Do not use the Save the World option in the visual interface for this task. If you choose that procedure, you will not receive marks for this task.
Task 2: Program CheekyMouse class
If CheekyMouse is not trapped, the user can move it one cell down, up, left or right with curser keys to find cheese.
If it is trapped, display a message in to the console window indicating that it is trapped.
Sample message:CHEEKY MOUSE: Ouch, I’m trapped.
If CheekyMouse reaches its home:
- Make the mouse shout hooray.
- Stop the Greenfoot scenario.
- Display a message in the console window indicating the user wins the game.
- Display the count of cheese points the user collected in the console window.
The user can collect one cheese point for every piece of cheese eaten by the CheekyMouse.
Sample message:
CHEEKY MOUSE: Congratulations! You win the Game.
CHEEKY MOUSE: Total cheese points earned=A^
^ replaced by the number of cheese pieces eaten by the Cheeky mouse.
Hints:
- You may use the methods given in Mouse Class.
- For the action, “it shouts hooray”, you should write your own method or, at a minimum, you should play the “hooray.wav”.
Task 3: Program MouseTrap class
Catch the mouse if it steps into the trap.
If it is trapped,
- Stop the Greenfoot scenario.
- Display a message to the console window indicating in which cell number in the CheeseWorld grid this accident happened.
Sample message:MOUSE TRAP: CheekyMouse is trapped at grid cell xx*.
* xx replaced by the cell number.
Note: The grid numbering pattern is as follows.
Hints:
- You may use the methods given in MouseTrap Class to program the act()
- Use The getX() and getY() methods from Actor Class to find the x coordinate and y coordinate values of the MouseTrap to calculate the Grid number.
Task 4: Program LazyCat
When theLazyCatis created in the CheeseWorld, it is in sleep status by default. However,LazyCat can be in one of two states (sleep/awake) during program execution.
Program the sleep behaviour of the LazyCat. You should display the sleeping cat image (use “small-cat-sleep-3.png”) and set the status to sleep.
Program the awake behaviour. You should display the image “small-cat.png” for the LazyCat. Set the status to awake.
If it is time to wake up, it wakes up. Make it perform a Mouse screening routine. Otherwise it is to go to sleep.
The CheekyMouse screening routine should be programmed as follows:
If it sees the CheekyMouse,
- Eat the Mouse.
- Dance##.
- Stop the Greenfoot scenario.
- Display a message to the console window indicating how many cheese it had saved.
Sample message: LAZY CAT: Game Over! No more hassle from Cheeky Mouse! Saved y** pieces of cheese.
** replaced by the number of Cheese objects left in the world.
##Dance routine in LazyCat dance consists of the following four steps.
Step 1: Hands in the air
Step 2: Flying
Step 3: Pointing up to the Right
Step 4: Pointing up to the Left.
LazyCat will perform the above four steps 4 times in this specific dance routine. Call thewait() method between each step.
Figure 4 gives the image name and image for each of the above steps.
“linus-song-loop.wav” should play in background during the dance performance.
Also Read: C++ Programming Assignment
Marking criteria and standards
Marks for this assessment will be based on the correctness and completeness of the student’s submission. The marking criteria for the assignment are given in the following table. Students will receive no marks if they fail to submit the assessment within 10 days of the due date without an approved extension or special consideration.
Marking Guide
Applying top-down modular design principles and using suitable data types and data structures such as arrays to store relevant data ( 10+10 =20 marks) | |
Encode the given object pattern using an integer array in Java (Task 1) | 9 |
Good decision on local and field variables in Java(Task 1) | 5 |
Efficient program with code reuse (e.g. using method catchMouse() in Task 3 and using isTimeToWakeUp() and canSeeMouse() in Task 4). All methods written in Java | 2+2+2 |
Develop structured programming techniques using Java to solve the given problem(30 marks) | |
Task 1 | |
Get User Input using an input dialogue box and convert it to an integer number. | 2 |
Input validation: keep displaying the input dialogue box, if user entered an invalid input | 2 |
Update the mode correctly | 1 |
Generic code to place all the objects correctly into the world according to the specified pattern for game mode 0. | 3 |
Place all the objects correctly into the world according to the specified pattern for game mode 1. | 3 |
Place all the objects correctly into the world according to the specified pattern for game mode 2. | 3 |
Task 2 | |
If CheekyMouse is trapped display an appropriate message to the console window | 2 |
If CheekyMouse is not trapped, move it one cell down, up, left or right with curser keys to find cheese | 2 |
If CheekyMouse reaches its home, program the required routine | 2 |
Task 3 | |
If it caught, stop the Greenfoot scenario | 2 |
If it caught, display the cell position where it is trapped | 2 |
Task 4 | |
Program the wake-up behaviour in LazyCat | 2 |
Program the CheekyMouse screening routine | 4 |
Code compiles free of syntax errors and runtime errors (20) | |
No compiling errors | 10 |
No runtime errors | 10 |
Good coding practices (30) | |
Meaningful names for identifiers | 10 |
Indented and easy to read code | 10 |
Each method is documented | 10 |