CS2212 - Introduction to Software Engineering
Individual
Assignment
Due Date: Monday, Feb 6th, 11:59 pm
Percentage of final mark: 10%
This is an individual assignment. Each individual student in the class is to hand in a separate assignment via Webct. READ OVER THE ENTIRE ASSIGNMENT INSTRUCTIONS BEFORE STARTING ANY CODING!
Purpose --> to gain experience:
- planning a Graphical User Interface
- implementing a simple application with a Graphical User interface in Java for a Blackberry
- implementing a simple application with a Graphical User Interface in Java as a stand alone application for Windows
The Problem:
- Implement the game of Hangman for 2 players.
- There will be 3 categories: TV Shows, Movies and Phrases. The first time playing, TV Shows will be the default category. After that, remember the category that the players selected when the players quit and then start with that category. Ask them if they want to continue with that category or switch to one of the other two. Once the players picks a category, that will be the category they play for the whole game until they quit and that category will be the default category when they start up the game again.
- Ask player 1 to enter an appropriate puzzle for the selected category while player 2 closes his/her eyes. If, for example, the category is Movies, then player 1 might enter the puzzle: Lord of the Rings. Then clear the screen and ask player 2 to enter his/her puzzle for the player 1, while player 1 closes his/her eyes, for example Star Wars. Note: the puzzle cannot be longer than 100 letters/spaces and cannot be less than 1 letter, then clear the screen again.
- Display the appropriate underlines and spaces(or you could use slashes) for the puzzle that player 1 suggested. Then have player 2 pick letters and, if player 2 picks a letter that was in the puzzle, then fill in the appropriate underlines with the letter that player 2 picked OR if player 2 picks a letter that was NOT in the puzzle, then display an image of a hangman with a new body part. Each player can make up to 6 incorrect guesses (head, left arm, right arm, body, left leg, right leg), on the 7th incorrect guess, draw a frown on the head and then the player loses. If the player picks a letter in the puzzle, allow him/her to solve the puzzle or pick another letter. If the player picks a letter that is NOT in the puzzle, then display the new body part and just allow the player to pick another letter, the player is not allow to solve the puzzle after making a bad letter pick.
- After player 1 is finished (either wins or loses), then allow player 2 to try player 1's puzzle.
- After both puzzles have been completed, say something like: Player 1 won OR Player 2 won OR Both Player 1 and Player 2 won! OR Both Player 1 and Player 2 lost! then allow the players to quit your game. Remember that when the game starts up again, it must be in the same category that the players were playing before they quit.
- HINT: for drawing the hangman, it might be easier to have 7 images (gifs or jpgs), each image will have one more body part drawn, than to actually try to draw the shapes using the x/y coordinates ... but, of course, it is up to you how you implement your solution :-)
- The programs must be named CS2212HangmanBlackberry and CS2212HangmanRegular
Your Tasks:
Task 1:
FULLY implement your solution in Java for a Blackberry with a graphical user interface using the J2ME and/or RIM classes. This
interface MUST have the following components:
- At least one text field
- At least one button
This program must:
- In Eclipse, be under an Eclipse Blackberry project called: yourwesternuseridBlackberry. So, if for example, your userid was jsmith77, then, in Eclipse, you would call the project jsmith77Blackberry (File>New>Other>Blackberry Project and give the project the name yourwesternuseridBlackberry)
- allow the user to quit at anytime (on the Blackberry, it is fine to have them quit by just hitting the return key numerous times)
HINT: The following web sites have some great Blackberry GUI
examples and sample code and shows you how to use all the standard Java GUI
components::
- UI Components Quick Reference Guide
- User Interface Field Reference
- Blackberry Fields and Borders and Backgrounds
- User Interface Overview
- Java Development Support Forum
Task 2:
FULLY implement your solution in Java for a PC with a graphical user interface using the Swing classes. You should not be using a tool such as Netbeans to slide around the controls, rather you should be creating the components by typing in the appropriate code. This
interface MUST have the following components:
- A menu with at least one menu item
- At least one text field
- At least one button (check box buttons and/or radio buttons and/or just
plain old buttons)
This program must:
- In Eclipse, be under an Eclipse Java Project called: yourwesternuseridSwing. So, if for example, your userid was jsmith77, then, in Eclipse, you would call the project jsmith77Swing (File>New>Java Project and give the project the name yourwesternuseridSwing)
- allow the user to quit at anytime
- allow the user to switch between two colour schemes
of your choice.
The colour scheme should change the background and foreground colours on the
components to the users options area. For example, if the user chooses the
"Sunset Colour Scheme", then your program might change the background colour
on the GUI components to orange and the foreground colour on the components
to red. HINT: it is much easier and more flexible to change the
foreground and background colours of the superclass than it is to
individually change each buttons/components colours.
HINT: The following web site has some great GUI
examples and sample code and shows you how to use all the standard Java GUI
components: http://docs.oracle.com/javase/tutorial/ui/features/components.html
Marking:
Non-compiling programs will NOT receive more than 40%. Non
working program (incorrect values, etc.) will not receive more than 60%
- Comments/Structure/Code Layout: 30% (10% each) USE OF
APPROPRIATE CLASSES, ONE BIG CLASS IS PROBABLY NOT THE BEST SOLUTION!
- Usability including ease of use: 10%
- Messages displayed to user: 5%
- Adherence to the specifications of this assignment:
15%
- Layout of screen: 5%
- Correctness of code: 30%
- Creativity/Display Style/Extra Effort: 5%
- Deduct 5% for each crash (do not deduct more than once
for multiple crashes caused by the same block of code)
- Both the Blackberry app and the Windows app will be marked as above and then each mark will be divided by 2 and added together (thus each block of code is worth 50% of your final mark for the individual assignment)
- You may write classes that might be able to used in both applications, it is fine (actually encouraged!) for you to reuse parts of your code in both applications.
WORDS OF ADVICE: Moss will be run to
check for cheating. It is better to receive 2 or 3 out of 10 for a non-compiling
program of your own work than it is to receive -10% AND an academic sanction for
a copied assignment.
Submission via WebCT:
This assignment must be submitted as a jar file via webct and you must submit a build file so the teaching assistant can easily compile and run your program. In order to do this, you must follow the following steps carefully:
- NOTE: we are assuming that you created your TWO (the blackberry and the standalone) projects in Eclipse. This assumption means that you will have TWO folders that represent the two parts of the project and will contain your .java files and .class files.
- While in Eclipse, viewing the Package Explorer window, make sure that the only open projects are your cs2212 Individual assignment standalone project and your cs2212 Individual assignment Blackberry project. CLOSE ALL OTHER PROJECTS IN YOUR ECLIPSE PACKAGE EXPLORER
- From the menu at the top of Eclipse, select File>Export>General>Archive File and then click on the Next button. You should now only see your two projects with a checkbox next to each of them, check off both of these projects. In the box that says "To archive file:", put your Western user id followed by an underscore and then cc2212, thus if your name was John Smith and your userid was jsmith77, then you would put the archive file name of: jsmith77_cs2212. Then click on the Finish button.
- Log onto webct and select the Individual Assignment under assignments and then attach the file: youruserid_cs2212.zip
- Log onto webct and go to Individual Assignment, click on the button "Add Attachments" and then attach the file: youruserid_cs2212.zip to webct and then click on the Submit button.
- NOTE: Please put a comment in the webct Add Comments box of the assignment submission form IF part of your assignment (for example, the Blackberry portion) is not working so that the t.a. doesn't waste time trying to get code to run that is not runnable. The comment should tell the t.a. which part works and which part doesn't work. The t.a.s will still mark this code but you wont get above 40% on that portion of the assignment. (thus you should hand in all of the coding you attemped, even if it doesn't work incase you receive part marks). Also, if you have any special instructions that you think will help the t.a. to get your program running, please include them also in the add comments box of webct!
- Hit the submit button, click on Okay
LATE POLICY:
This assignment can be up to two days late. If it
is 0 to 24 hours late, you will lose 20% off of your assigned mark, if it is 24
to 48 hours late, you will lose 40% off of your assignment mark.