Tuesday, December 3, 2013

Penn Foster 037097 Final Graded Project HangMan

Penn Foster 037097 – Guaranteed 100% score

Page 201,Josh Hester, HangMan, Execute and Re-Tested, Win and Lost, Sql Server DB Access, Previews A+ Solution.


Click Below Link To Download!

YOUR PROJECT
You’ve been tasked to create an educational game for a fifth grade reading class. 
The game must test students’ spelling
skills using a variation of the classic game Hangman. If you’re
unfamiliar with the rules and general game play, please
consult the online reference at http://en.wikipedia.org/
wiki/Hangman_(game) for more information.

Database
The application will use the HangManDB.MDF file. The
HangManDB database contains the tables shown in
Figure 59.
The UnitID column in the Words table is a foreign key to the
ID column in the Units table. The Word column contains the
actual word to guess, while the Description column contains
the description of words for that unit.
201

User Interface
The user interface will consist of a single Windows form. The
user interface will resemble Figure 60.
202 Final Graded Project

FIGURE 59—HangManDB Database Tables
FIGURE 60—Hangman

User Interface
When the application first loads, the textbox for the letter
guess should be disabled. If the New option is chosen in the
menu, then a new word and the unit description should be
loaded from the database. If the Quit option is chosen in the
menu, then the application should quit.
After each guess, one of two things should happen. If it was
a correct guess, then all occurrences of that letter should
appear in the labels at the bottom. If it’s an incorrect guess,
then the next stage of the hangman should appear in the
picture box. In either case, the textbox should highlight the
letter, so that the user can make another guess. The textbox
should not be cleared, or the user may attempt to guess the
same letter (Figure 61).

Final Graded Project 203
FIGURE 61—The incorrect guessed letters should
appear in the picture box and remain as other incorrect
guesses are added. 
The game ends when either all letters of the word are guessed 
correctly or the hangman picture is completed. When the game is won,
a message box should display like this one
(Figure 62):

When the game is lost, the message box should display words similar 
to Figure 63.

In either case, clicking the Yes button should have the same 
effect as clicking the

New option in the menu and clicking the No button should exit 
out of the application.
This will be the last graded project based on this scenario.
You’ll be graded on the end-user functionality, so variable
names and other aspects can differ, but the application must
work as intended.
Application Files
This application will consist of the following files in the solution
explorer:
1. GameForm.vb. The only form in the application.
2. HangmanDB.MDF. The database that contains the questions
and unit descriptions. See Provided Files section
below for more information.
3. Images folder. Hangman-0.png, Hangman-1.png,
Hangman-2.png, Hangman-3.png, Hangman-4.png,
Hangman-5.png, and Hangman-6.png. See “Provided
Files” section below for more information.
204 Final Graded Project
FIGURE 62—You won! Do you want to play
again?
FIGURE 63—You lost. Do
you want to play again?
4. QuestionDataSet.xsd. The DataSet for the HangmanDB
database. Should contain both tables Words and Units.
Provided Files
You’ll be provided the following files:

The HangmanDB.MDF database
The images folder that contains the image files

Hangman-0.png, Hangman-1.png, Hangman-2.png,
Hangman-3.png, Hangman-4.png, Hangman-5.png,
and Hangman-6.png

You should add these files to your project as described in
step 3 in the Instructions section.

INSTRUCTIONS
1. In Visual Studio, create a new Windows Forms project
named HangmanApp.
2. Rename the Form1.vb file to GameForm.vb.
3. Add the provide files to your project. Use the Add >
Existing Item… option in the Solution Explorer. Make
sure in the Properties panel to set the Copy To Output
property to Copy Always.
4. Create the DataSet named QuestionDataSet.xsd using
the HangmanDB.MDF file. Review Assignment 15.
5. Create the user interface for GameForm.vb. See the
User Interface section above for the layout. The form
will consist of the following controls:
a. One MenuStrip control that contains the Game menu
with the options New and Quit.
b. One Label control with the text Guess a letter.
c. One Label control with the text Choose New Game.
This label will display the unit description during the
game.
d. One TextBox control for the user type in letter
choices.
Final Graded Project 205
e. A PictureBox control that will display the hangman
images. You’ll set the ImageLocation property to load
the hangman images.
f. A Panel control that will contain the displayed letter
labels.
g. Eleven Label controls, one for each letter of the word.
These labels should be in the panel. You should set
the initial value for the Text property to the underscore
character (_) to act as a placeholder character.
You can chose to set the control properties to whatever
you like, but below are some helpful suggestions. If you
don’t name the controls the same names, you’ll need to
modify some provided code in the next steps.
For a further description on how to add and layout
controls, review Assignment 11 and Assignment 13.
6. In the code of GameForm.vb, you should define the
following variables:
a. dsQuestions. A QuestionDataSet object
206 Final Graded Project
GameForm Size: 500, 500
Label for unit description (Name): lblUnitDescription
Font.Size: 14
TextBox for letter guesses (Name): txtGuess
Font.Size: 22
MaxLength: 1
PictureBox for hangman images (Name): pboxHangman
Size: 256, 256
Panel for letter labels (Name): panelWord
Dock: Bottom
Eleven Label controls for letters Set the (Name) property for
each to lblLetter0 to
lblLetter11. The last character(
s) will match the character
index in the word.
Font.Size: 22
Text: _
b. numWord. The index of which word is being guessed.
This matches the row in the Words table that’s being
retrieved. Each game will increment this number by
one.
c. word. The actual word being guessed.
d. numWrongGuesses. Number of wrong guesses in a
game.
e. numRightGuesses. Number of right guesses in a
game.
f. gameStarted. Indicates whether the game has started
or not.
6. In the code of GameForm.vb, you should have the following
event procedures:
a. Form Load event handler—Disable the txtGuess
textbox, set the numWord variable and call the
LoadData method (provided below).
b. Quit button Click event handler—Exit the application
c. In the New button Click event handler, perform the
following tasks:
I. Initialize all variables, especially numRightGuesses,
numWrongGuesses, gameStarted, and
numWord. Make sure to increment numWord to
the next index.
II. Initialize controls. Clear the text of all labels,
enable and set the focus to the txtGuess textbox.
III. Set controls using the DataSet. If you followed
the same names, then you can use this code:
‘Gets word column row
word = CStr(dsQuestions.Words(numWord)(1))
‘Gets unit description
lblUnitDescription.Text = _
CStr(dsQuestions.Words(numWord).UnitsRow(1))
IV. Set the label control for each character in the
word. Set the Text property to the underscore
character (_).
Final Graded Project 207
d. In the txtGuess textbox TextChanged event, perform
the following tasks:
I. Check if the game is started using the
gameStarted variable.
II. Check to see if the word (word) contains the
guess (txtGuess).
III. If it does, then call the SetRightLetterLabels
method (provided below) and increment the
numRightGuesses variable.
IV. If it doesn’t, set the image in the pboxHangman
and increment the numWrongGuesses variable.
Your code should resemble the following:
pboxHangman.ImageLocation = “images\Hangman-” &
numWrongGuesses & “.png”
numWrongGuesses += 1
V. Check to see if the game has been won or lost
yet. Use the CheckProgress method. See step 7A
for how the CheckProgress method is defined.
VI. Select all of the text in the txtGuess textbox.
7. In the code of GameForm.vb, you might find it helpful to
define the following methods:
a. A method named CheckProgress that calculates the
total number of tries (numRightGuesses +
numWrongGuesses), displays the correct message box
for winning or losing, and starts the next game or
exits the application depending on the message box
button.
b. A method named WonGame that checks each letter in
the word is matched by its label and returns True if
this is the case.
c. A method named LostGame that checks to see if the
number of wrong guesses is greater than six and
returns True if this is the case.
d. A method named ResetAllLabels that sets each character
label to blank text.
208 Final Graded Project
8. In the code of the GameForm.vb, you might want to add
these helper methods:
Private Sub LoadData()
Dim taUnits As New
QuestionDataSetTableAdapters.UnitsTableAdapter
Dim taWords As New
QuestionDataSetTableAdapters.WordsTableAdapter
taUnits.Fill(dsQuestions.Units)
taWords.Fill(dsQuestions.Words)
End Sub
Private Function FindLabel(ByVal i As Integer) As
Control
‘Finds the right label in the Word panel
Dim label = panelWord.Controls.Find(“lblLetter” & i,
False)(0)
Return label
End Function
Private Sub SetRightLetterLabels(ByVal word As String,
ByVal ch As Char)
For i As Integer = 0 To word.Length – 1
‘Check for each letter and set the appropriate
letter
If word.Chars(i) = ch Then
FindLabel(i).Text = ch
End If
Next
End Sub
9. Save and run the application. Verify that all controls and
menus work correctly. You’ll submit the compiled application
for this project according to the submission
guidelines on that follow.
Final Graded Project 209

Preview Solution:
Penn Foster 037097

Page 201,Josh Hester, HangMan, Execute and Re-Tested, Win and Lost, Sql Server DB Access, Previews A+ Solution
  • This tutorial was purchased 1 time and rated A+ by students like you.
  • Posted on Apr. 03, 2013 at 06:44:13AM
Price: $50
Special Price: $40
Email: syedjahangirb@gmail.com for downloading assignment
Download Directly from: http://www.askassignment.com/product/penn-foster-037097-final-graded-project-hangman-josh-hester

File in Solution:
Preview.jpg (42K) (Preview)
HangManApp.zip (746K)
[
HangManApp/HangManApp/app.config
HangManApp/HangManApp/bin/Debug/HangMan.vshost.exe
HangManApp/HangManApp/bin/Debug/HangMan.vshost.exe.manifest
HangManApp/HangManApp/bin/Debug/HangManApp.exe
HangManApp/HangManApp/bin/Debug/HangManApp.exe.config
HangManApp/HangManApp/bin/Debug/HangManApp.pdb
HangManApp/HangManApp/bin/Debug/HangManApp.vshost.exe
HangManApp/HangManApp/bin/Debug/HangManApp.vshost.exe.config
HangManApp/HangManApp/bin/Debug/HangManApp.vshost.exe.manifest
HangManApp/HangManApp/bin/Debug/HangManApp.xml
HangManApp/HangManApp/bin/Debug/HangmanDB.mdf
HangManApp/HangManApp/bin/Debug/HangmanDB_log.ldf
HangManApp/HangManApp/bin/Debug/Images/Hangman-0.png
HangManApp/HangManApp/bin/Debug/Images/Hangman-1.png
HangManApp/HangManApp/bin/Debug/Images/Hangman-2.png
HangManApp/HangManApp/bin/Debug/Images/Hangman-3.png
HangManApp/HangManApp/bin/Debug/Images/Hangman-4.png
HangManApp/HangManApp/bin/Debug/Images/Hangman-5.png
HangManApp/HangManApp/bin/Debug/Images/Hangman-6.png
HangManApp/HangManApp/bin/Release/HangManApp.exe
HangManApp/HangManApp/bin/Release/HangManApp.exe.config
HangManApp/HangManApp/bin/Release/HangManApp.pdb
HangManApp/HangManApp/bin/Release/HangManApp.xml
HangManApp/HangManApp/bin/Release/HangmanDB.mdf
HangManApp/HangManApp/bin/Release/HangmanDB_log.ldf
HangManApp/HangManApp/bin/Release/Images/Hangman-0.png
HangManApp/HangManApp/bin/Release/Images/Hangman-1.png
HangManApp/HangManApp/bin/Release/Images/Hangman-2.png
HangManApp/HangManApp/bin/Release/Images/Hangman-3.png
HangManApp/HangManApp/bin/Release/Images/Hangman-4.png
HangManApp/HangManApp/bin/Release/Images/Hangman-5.png
HangManApp/HangManApp/bin/Release/Images/Hangman-6.png
HangManApp/HangManApp/GameForm.Designer.vb
HangManApp/HangManApp/GameForm.resx
HangManApp/HangManApp/GameForm.vb
HangManApp/HangManApp/HangManApp.vbproj
HangManApp/HangManApp/HangManApp.vbproj.user
HangManApp/HangManApp/HangmanDB.mdf
HangManApp/HangManApp/HangmanDB_log.ldf
HangManApp/HangManApp/Images/Hangman-0.png
HangManApp/HangManApp/Images/Hangman-1.png
HangManApp/HangManApp/Images/Hangman-2.png
HangManApp/HangManApp/Images/Hangman-3.png
HangManApp/HangManApp/Images/Hangman-4.png
HangManApp/HangManApp/Images/Hangman-5.png
HangManApp/HangManApp/Images/Hangman-6.png
HangManApp/HangManApp/My Project/Application.Designer.vb
HangManApp/HangManApp/My Project/Application.myapp
HangManApp/HangManApp/My Project/AssemblyInfo.vb
HangManApp/HangManApp/My Project/Resources.Designer.vb
HangManApp/HangManApp/My Project/Resources.resx
HangManApp/HangManApp/My Project/Settings.Designer.vb
HangManApp/HangManApp/My Project/Settings.settings
HangManApp/HangManApp/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache
HangManApp/HangManApp/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
HangManApp/HangManApp/obj/x86/Debug/HangMan.GameForm.resources
HangManApp/HangManApp/obj/x86/Debug/HangMan.Resources.resources
HangManApp/HangManApp/obj/x86/Debug/HangManApp.exe
HangManApp/HangManApp/obj/x86/Debug/HangManApp.pdb
HangManApp/HangManApp/obj/x86/Debug/HangManApp.vbproj.FileListAbsolute.txt
HangManApp/HangManApp/obj/x86/Debug/HangManApp.vbproj.GenerateResource.Cache
HangManApp/HangManApp/obj/x86/Debug/HangManApp.xml
HangManApp/HangManApp/obj/x86/Debug/TempPE/My Project.Resources.Designer.vb.dll
HangManApp/HangManApp/obj/x86/Debug/TempPE/QuestionDataSet.Designer.vb.dll
HangManApp/HangManApp/obj/x86/Release/DesignTimeResolveAssemblyReferences.cache
HangManApp/HangManApp/obj/x86/Release/DesignTimeResolveAssemblyReferencesInput.cache
HangManApp/HangManApp/obj/x86/Release/HangMan.GameForm.resources
HangManApp/HangManApp/obj/x86/Release/HangMan.Resources.resources
HangManApp/HangManApp/obj/x86/Release/HangManApp.exe
HangManApp/HangManApp/obj/x86/Release/HangManApp.pdb
HangManApp/HangManApp/obj/x86/Release/HangManApp.vbproj.FileListAbsolute.txt
HangManApp/HangManApp/obj/x86/Release/HangManApp.vbproj.GenerateResource.Cache
HangManApp/HangManApp/obj/x86/Release/HangManApp.xml
HangManApp/HangManApp/obj/x86/Release/TempPE/My Project.Resources.Designer.vb.dll
HangManApp/HangManApp/obj/x86/Release/TempPE/QuestionDataSet.Designer.vb.dll
HangManApp/HangManApp/QuestionDataSet.Designer.vb
HangManApp/HangManApp/QuestionDataSet.xsc
HangManApp/HangManApp/QuestionDataSet.xsd
HangManApp/HangManApp/QuestionDataSet.xss
HangManApp/HangManApp.sln
HangManApp/HangManApp.suo
]

No comments:

Post a Comment