Visual Basic Assignment:
Please write these programs using Visual Basic. I would prefer
that you use version 6 (it is available from MSDN). If you
want to work at home and it is not compatible, then you can
use version VB.NET 2003 or 2005. I do not have 2008 installed.
If you need help in getting started in these versions, I have
information under CIS56 and there are tutorials on the web or
you can see me for help. The next assignment is a lot easier
in VB6 so you may find it easier to do that assignment in the
labs. This assignment can be done in any version.
- Problem #1: Calculation (compare this to the one you did in JavaScript)
Write a program using Visual Basic that will let the user key in to textboxes the hours worked,
the pay per hour and the amount they want to withhold. Have the computer then calculate the pay
and display it in a textbox. I also want you to have a message box that will display the message,
I need a raise if the calculated pay is under 1000 and display a message saying OK if the
calculated pay is not under 1000. I want to see some color and some bold, italics or a change of
font on the form.
- Problem #2:
Write a program to take in an exam grade, a project grade and homework grade (they should be
entered as numbers). You should then calculate the average giving each one equal weight.
Finally you should display the letter grade that the student will receive using IF statements.
- Problem #3:
Write a program that contains a loop that you will do 5 times. Inside the loop, you want to use
an InputBox to take in an amount and add it to a total. When the loop is done, you want to print
out the total in a text box on the form. The loop should be started by clicking a command button.
- Problem #4:
Revise the for… next program we looked at in class (ProjFor1.vbp and frmFor2.frm under programs)
to use three nested loops. You should be adding the first two numbers together and then multiplying
by the third number. (My example just adds the two numbers together).
- Problem #5: Set up the following array for places you want to visit. You should have a textbox
to take in the trip number and a textbox to hold the destination that is returned. Invalid
entries should display a message.
| Trip Number |
Destination |
| 1 |
London |
| 2 |
Paris |
| 3 |
Lisbon |
| 4 |
Sydney |
| 5 |
Baku |
| 6 |
Pretoria |
| 7 |
Buenos Aires |
| 8 |
Toyoko |
- Problem #6: Write a program that creates a file. The file should have three or four fields.
- Problem #7: Write a program that reads the file you created and displays the information.