Week 4
Remember Hotel Highlander, Tutorial 4-2 and 4-3, Tutorial 4-10 are HW.
Tutorial 4-2 page 198
Download code from Website Chapter 4 – Test Average 2
You will have to use WinZip in the lab. Right click your mouse and extract the same name of the path your are using. Eg. C:\Documents and Settings\temp\MyDocuments\Chap4. Use evaluation version – Classic – Express
Note:
Book Website: http://www.aw-bc.com/gaddisvb/
if you follow the link to companion website ->student, you will get the
website for your book: http://wps.aw.com/aw_gaddis_vb2008_4/82/21176/5421292.cw/index.html
Right click your project
from chapter 4 and deselect Read-Only.
Create a new project, call
it Test Score Average 2 2003
Copy the file called
Form1.vb from your Test Score Average 2 (Note: your 2008 version)
Paste the code into Test
Score Average 2 2003, build and execute
Delete code that creates
error messages:
Me.btnExit.UseVisualStyleBackColor = False
Me.btnClear.UseVisualStyleBackColor = False
Me.btnCalculate.UseVisualStyleBackColor = False
It is the code that is underlined. As you delete this code, you will
have less compiler errors each time.
Follow the book
instructions on page 198 Tutorial 4-2
Notice:
sngAverage.ToString("n")
formats the string. Try to remove (“n”) and see the difference.
Follow the book
instructions on page 201 Tutorial 4-3
Go
to page 201 and continue finishing your program. This time you will be
providing letter grades to your program.
Remember
to add lblGrade.Text = "" to your clear
button, otherwise it will continue to have the grade after it has been cleared.
Tutorial 4-10
page 251
Learning about radio
buttons, select case, if – else if
Must do to get
credit!!!!!!
Page 256 Step 8 lblTotal.Text is not correct. The correct variable is lblTotalFee.Text
Problem: 2008
has function that does not exist in 2003, change function to CInt( String value )
If Not Integer.TryParse(txtMonths.Text, intMonths) Then
MessageBox.Show(“Months must be valid integer”, _
“Input Error”)
Return
End If
Change to 2003 version,
which should work with 2008 also:
Try
intMonths
= CInt(txtMonths.Text)
Catch ex As Exception
MessageBox.Show(“Months must be valid integer”, _
“Input Error”)
Return
End Try