Concentrate on the examples marked with an asterisk (*) when studying for the final exam.
HelloWorld1 (C)  
Module1.vb
Traditional Hello World program as a console application.
HelloWorld2 (W)  
Form1.vb
Hello World project displaying the message in a label on a Windows form.
Greeter1 (C)  
Module1.vb
Read the name of a person. Then print a greeting to that person.
* Greeter2 (W)  
Form1.vb
Input the name of a person in a textbox. Output a greeting to that person
in another textbox when the Show button is clicked.
* DisplayImage (W)  
Form1.vb  
EarthFromMoon.jpg
When Display button is clicked, display EarthFromMoon.jpg image.
Copy the image into the bin folder of the solution before
running the application.
When the Reset button is clicked, clear the picture box.
* Temperature2 (W)  
Form1.vb
Input Celsius temperature in a textbox. Output temperature in Fahrenheit
to another textbox.
Mortgage1 (C)  
Module1.vb
Input principal, interest rate and loan duration at the keyboard.
Output monthly payment to the console.
* Mortgage2 (W)  
Form1.vb
Input principal, interest rate and load duration at the keyboard.
Output monthly payment to the console. ForeColor changes to Red when
the the textbox has the focus.
Input-MessageBox (W)  
Form1.vb
Input name using an input box. Display a greeting (including the name)
with a message box.
* Controls (W)  
Form1.vb
Input data using VB controls. Display the contents of the controls
in a message box.
PictureBoxes (W)  
Form1.vb
Change the Left, Top, Width, Height and BackColor properties
of picture boxes at runtime.
Tax (W)  
Form1.vb
Input a value, output the tax.
Gpa1 (W)  
Form1.vb
Input the total grade points and total credit hours, output the gpa.
Pythagorean (C)  
Module1.vb
Input the starting and ending points, output the distance between
them.
DaysOfWeek1 (C)
Module1.vb
Input day code, choose day of week name with If..Else statements.
DaysOfWeek2 (C)
Module1.vb
Input day code, choose day of week name with Select statements.
* TempDescriptors (C)
Module1.vb
Describe temperatures verbally.
* Beverage (W)
Form1.vb
A breakfast beverage order form.
* Pink (W)
Form1.vb
Use the trackbar to change the background color of the picturebox
from red to pink to white.
Over90 (W)
Form1.vb
Enter scores sequentially. Output count of scores >= 90.
* Gpa2 (W)
Form1.vb
Input sequentially grades and credit hours of courses.
Output gpa.
Overtime (W)
Form1.vb
Input sequentially the hourly wage and total hours of each employee
for a week. The current total salaries is displayed.
RepSent1 (C)  
Module1.vb
Repeat a sentence 100 times using a Do loop.
RepSent2 (W)  
Form1.vb
Repeat a sentence 100 times using a For loop.
Sum1To100 (C)  
Module1.vb
Sum numbers from 1 to 100 using a For loop.
Arrays (C)  
Module1.vb
Create and print arrays of Integer and String.
* ArraySort (C)  
Module1.vb
Create, sort and print array of Integer.
ArraySearch (C)  
Module1.vb
Search an array object to see if a name exists in it.
SplitFunction (C)  
Module1.vb
Show how to use the Split function to extract fields from
a String.
* AveWordLength (C)  
Module1.vb
Put this input file in the bin folder:
Words.txt
Compute the average word length in an input file.
* ShowWords (W)  
Form.vb
Put this input file in the bin folder:
Words.txt
Display words from a file in a textbox.
WriteToFile (C)  
Module1.vb
Show how to write to an output file.
* ListBox (W)  
Form1.vb
Using a ListBox control. Adding elements at design and run time.
* ComboBox (W)  
Form1.vb
Using a ComboBox control. Adding elements at design and run time.
TelephoneButtons (W)  
Form1.vb
Display an ArrayList of buttons on a form. Use a common event
handler to check when one of them is clicked.
PhoneBook2 (W)  
Form1.vb
Windows application with one array list for name and one for phone number.
* PhoneBook-NoArrays (W)  
Form1.vb
After the user enters a name, look up the name and corresponding
phone number in the input file
PhoneBookNumbers.txt. Place this file in the bin folder.
PhoneBook3 (W)  
Form1.vb
Windows application with one array list for comma delimited string.
Use Split function to extract fields.
* PhoneBook4 (W)  
Form1.vb
PhoneBookNumbers.txt
Windows application with one array list for comma delimited string. Load
information from file.
* Subroutine (C)  
Module1.vb
Show example of subroutine definition and invocation.
OldMcDonald1 (C)  
Form.vb
Input an animal and a sound. Output a verse
from the OldMcDonald children's sound.
SubroutineTrace (C)  
Module1.vb
Construct the program trace and predict the output.
* Function (C)  
Module1.vb
Define and test a function to square a number.
Can you reduce the body of Main and Square to
one line each?
IsPrime (W)  
Form1.vb
Use a function to determine if an input integer is a prime.
Recall that an integer is prime if its only factors are 1
and the number itself.
* OldMcDonald2 (C)  
Form.vb
Input an animal and a sound. Output a verse
from the OldMcDonald children's sound. Use a function
to get the song.
FunctionTrace (C)  
Module1.vb
Construct the program trace and predict the output.
RepSent3 (C)  
Module1.vb
Input sentence to repeat and number times to repeat.
Output sentence n times.
* SymbolGrid (C)  
Module1.vb
Write a subroutine to display a grid of symbols.
* VowelCount (C)  
Module1.vb
Write a function to count the number of vowels in the
input string.
* IsFourLetterWord (C)  
Module1.vb
Write a function to return True is the length of the
input string is four, False otherwise.
* RandomNumbers (C)  
Module1.vb
Use the Next and NextDouble methods of the Random class
to generate random numbers.
* DieRolls (W)  
Form1.vb
Simulate 60,000 rolls of a fair die.
Count the number of sixes.
Snakeeyes (W)  
Form1.vb
Simulte rolls of two fair dice.
Count number of rolls to obtain snakeyes (pair of ones).
ConsultantBSGenerator (W)  
Form1.vb
Construct a "consultant" sentence using random words.
Groceries1 (W)
Follow the directions in
Groceries1 Example Directions
to create the example.
Groceries2 (W)  
Form1.vb
Create datebase objects from code and set up data binding
from dataset to textboxes.
Groceries3 (W)  
Form1.vb
Create database object from code and display data in
textboxes directly from the dataset (no data bindings).
* Groceries4 (W)  
Form1.vb
Construct SQL statement based on the Code textbox and
display other fields corresponding to that Code value.
* Groceries5 (W)  
Form1.vb
Select items to display in a multiline textbox according to
whether the items are on sale.
* Groceries6 (W)  
Form1.vb
Construct SQL statement based on the item name selected from
the combo box. Display other fields corresponding to that
ItemName value.
* Groceries7 (W)  
Form1.vb
Construct SQL statement based on the Code textbox and
display other fields corresponding to that Code value.
This is the same as the Groceries4 Example WITHOUT using
data binding.
* Groceries8 (W)  
Form1.vb
Construct SQL statement based on the item name selected from
the combo box. Display other fields corresponding to that
ItemName value. This is the same as the Groceries8 Example
WITHOUT using data binding.
* PhoneBookDB (W)  
Form1.vb
Use Method 3 to look up and display a phone number,
given the name. Put the database PhoneNumbers.mdb in
PhoneNumbers.zip.
Xrays (W)  
Form1.vb
When the name of a dental patient is selected,
display the ID and Xrays in a picture box.
The Xrays are stored in an ImageList control.
Use the database in
Xrays.zip for the Xrays
example. Place it in the C:\ folder.
Here are some Xray images to use for this example.
Place them in the bin folder for the project.
Xray1.jpg
Xray2.jpg
Xray3.jpg
Xray4.jpg
RealEstate (W)  
Form1.vb
frmHouse.vb
HousePoint.vb
RiverPoint.vb
Use the database in
RealEstate.zip for the RealEstate
example. Place it in the C:\ folder.
Display information about houses graphically in a picture box.
If user wants more information, clicking on a house point
brings up a secondary window with more information.
CountBlanks (C)  
Module1.vb
Count the number of blanks in an input string.
* Reverse1 (C)  
Module1.vb
Read a string from an input file and write the reversed
string to an output file.
* Reverse2 (C)  
Module1.vb
Write a function that inputs a string and returns the
reversed string. Test your function in the Main
method.
PersonsMethod2 (W)  
Form1.vb
Display the PersonData table of persons.mdb sequentially
in textboxes. This is Review Question 12 of the 7/6/06 Lecture
Notes.
DateTimePicker (W)  
Form1.vb
Show how to extract the month and day from a DateTimePicker
control.
MenuExample (W)  
Form1.vb
Create a basic menu with the menu editor.
OpenFileDialog (W)  
Form1.vb
Show how to use an OpenFileDialog and how to cancel a Form_Closing event.
Password (W)  
frmMain.vb
frmLogin.vb
frmSecret.vb
Add these three forms to the project. Make sure that
frmMain is set as the startup form.
FormEvents (W)  
frmA.vb
frmB.vb
Illustrate some of the Form events. Note that additional forms
must be explicitly created as objects.
MouseClicks (W)  
Form1.vb
Display locations of MouseClicks in message boxes.
Scribble (W)  
Form1.vb
Capture the coordinates of MouseMove events and store e.X
and e.Y in ArrayList objects so that the mouse movements
can be recreated in the Paint event handler.
Xrays2 (W)  
Form1.vb
frmXray.vb
When the name of a dental patient is selected,
display the ID and Xrays in a picture box.
The Xrays are stored in an ImageList control.
Use the database in
Xrays.zip for the Xrays
example. Place it in the C:\ folder.
Here are some Xray images to use for this example.
Place them in the bin folder for the project.
Xray1.jpg
Xray2.jpg
Xray3.jpg
Xray4.jpg
Cherries (W)  
Form1.vb
Brushes (W)  
Form1.vb
* RandomPoints (W)  
Form1.vb
RandomLines (W)  
Form1.vb
RandomCircles (W)  
Form1.vb
Wave (W)  
Form1.vb
Sunset (W)  
Form1.vb
Drawing
* Art (W)  
Form1.vb
Use the Graphics object drawing methods to draw a picture.
An example drawing for the Drawing project.
Place this image in the source code folder:
Pizza.jpg
Show the effect of using these brushes:
SolidBrush, TexturedBrush, LinearGradientBrush, HatchedBrush
Use the Graphics object drawing methods to draw a picture
with random points.
Use the Graphics object drawing methods to draw a picture
with random lines.
Draw random circles in the Paint event handler of a picture box.
The circles are not redrawn until the Draw Circles menu item is
clicked.
Draw a stick figure that waves. Use a Timer object to control
the speed of the animation.
Draw an animated sunset, including sun, sky, and grass.Button Data
These examples use the dataset ButtonData.mdb in
ButtonData.zip.
The table name is ButtonTable.
ButtonData2 (W)  
Form1.vb
Draw strings in a picture box based on the data in the ButtonData.mdb
database.