Create a Windows Form application program that will calculate and display the career statistics
A. Lab # CIS 4
B. Lab 4 of 7: Loops (Iteration)
C. Lab Overview – Scenario / Summary:
TCOs:
5. Given a set of program specifications for a simple business problem requiring iteration, code and test a program that meets the specifications and employs best programming practices.
10. Given a program’s source code and its program specifications document, conduct a code walk-through to determine if the program meets the specification.
This lab will familiarize the student with For Next loops and Do While loops by calculating and displaying the total amounts of goals, assists, and points over a hockey player’s career.
D. Deliverables:
|
Step |
Deliverable |
Points |
|
5 |
Program Listing, Output, and Project Files |
45 |
The Dropbox deliverables include the following.
1. Include a zipped file with all the files from your Visual Basic project (see directions in Doc Sharing on how to collect and zip files.)
2. Create a single MS Word document and include the following:
· For each lab, copy and paste your code directly into the MS Word file
· Include screenshot(s) of your test data with test results. Enter enough data to demonstrate that all your code has been tested.
· Include another screenshot of the Visual Basic build output messages. Check your build output to make sure you have a successful build with (0) errors and (0) warnings. NOTE: The build output messages appear at the bottom of your window after you click the Build menu and before you click the Start Without Debugging option. Your build output messages provide a list of compiler warnings or errors and let you know whether your program compiled successfully.
· Include the Word document as part of the zipped project file.
3. Upload each part of the lab into its corresponding weekly Dropbox.
E. Lab Steps:
Preparation:
If you are using the Citrix remote lab, follow the login instructions located in the iLab tab in Course Home.
Locate the Visual Studio 2010 icon on the desktop. Click to open.
Lab:
|
Create a new project in VB.NET. Name your project CIS170A_Lab04.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Step 2: Program Description |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hint 1: As shown in the reading, use a Do loop to collect the season’s data, along with each season’s goal and assist information.
Hint 2: As shown in the reading, use a list box to list each season’s information
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The following is the Object, Property, Setting, Event chart for the form controls, and each input field will have a label/input field pair. Also, group the related information in the associated group box.
The form and form controls will be logically placed on the form, the controls aligned and sized, and a logical tab order assigned to each of the form controls.
You are free to experiment with colors and form design as you see fit. However, your application must meet the listed requirements.
Hint: to check if a textbox is the empty string, use the String.IsNullOrEmpty method, such as:
If Not String.IsNullOrEmpty(txtName.Text) Then
Hint: do not enable the button to get the statistics until the number of seasons has been validated, such as:
If seasons > 0 AndAlso seasons <= 20 Then e.Cancel = False btnGetStats.Enabled = True
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Step 5: Executing the Program |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
To execute your code, click Start and then start debugging. Check your output to ensure that you have space(s) where appropriate. If you need to fix anything, close your execution window, modify your code as necessary, and rebuild. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Step 6: Deliverables |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
1. Capture a screen print of your output (do a PRINT SCREEN and paste into an MS Word document). 2. Copy your code and paste it into the same MS Word document that contains the screen print of your output. 3. Save the Word document as CIS170A_Lab04_LastName_FirstInitial. 4. Zip up the Word document along with a complete set of project files into a single document. 5. Place deliverables in the Dropbox.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
END OF LAB |
Version 1.0 Page 1 of 9
4/9/2009 Lab Activity MDD WBG310-A1
Begin
Get: Name
Get: Seasons
0 < seasons <= 20?No
count <= seasons?
Get: Goals
Get: Assists
Yes
Points = Goals + Assists
TotalGoals = TotalGoals + Goals
TotalAssists = TotalAssists + Assists
TotalPoints = TotalPoints + Points
Count = Count + 1
End
Yes
count = 1
A
A
No
0 <= goals <=60?
Output:
“Goals must be between 0 and
60 –Try again”
No
Yes
0 <= assists <=60?
Output:
“Assists must be between 0 and
60 –Try again”
No
Yes
Output:
“Seasons must be
between 1 and 20 –
Try again”
Output
Season & Goals & Assists &
Points
Output:
Name & “ career statistics”
“Seasons & “ seasons &
“Goals: “ & TotalGoals &
“Assists: “ & TotalAssists &
“Points: “ & TotalPoints
Name empty?
No
Output:
“Name must be
provided”
Yes
�
�
Begin
Get: Name
Get: Seasons
0 < seasons <= 20?
Output: “Seasons must be between 1 and 20 – Try again”
0 <= goals <=60?
No
No
Output: “Goals must be between 0 and 60 – Try again”
count <= seasons?
Get: Goals
Get: Assists
Yes
No
Points = Goals + Assists TotalGoals = TotalGoals + Goals TotalAssists = TotalAssists + Assists TotalPoints = TotalPoints + Points
0 <= assists <=60?
Count = Count + 1
Yes
End
Output Season & Goals & Assists & Points
Output: Name & “ career statistics” “Seasons & “ seasons & “Goals: “ & TotalGoals & “Assists: “ & TotalAssists & “Points: “ & TotalPoints
Yes
count = 1
A
A
No
Output: “Assists must be between 0 and 60 – Try again”
No
Yes
Name empty?
Output: “Name must be provided”
Yes