Visual Basic Assignment:
Please write these programs using Visual Basic.
- Problem #1: You need to calculate an employees pay. To do this you will need:
• the number of hours the employee worked
• the number of hours the employee is contracted to work before the employee
receives overtime (for example, the employee might be contracted to work 40 hours and only
receives overtime for hours over 40)
• the pay per hour
• the rule for calculating over time (time and one half would be 1.5 while double
time would be 2)
Test this problem with information about an employee who did not work over their contracted
hours and again for an employee who did work over their contracted hours.
- Problem #2:
You have a product that is on sale. Each day of the sale, the price drops 10% from its previous price.
The sale lasts for 4 days. You should write a program that processes this problem using a loop. You want
to have an inputbox (like a prompt) for the original price. You want to put up a MsgBox giving the price of each
day of the sale. Use a loop and each pass through the loop should generate the sale price for a a day of
the sale and that is what you should display using a MsgBox. Note the MsgBox should come up for each day.
Remember the syntax for a message box is MsgBox(put what you want to display in here).
- Problem #3: Set up the following array for assignments. You should have a textbox
to take in the assignment number and a textbox to hold the assignment name that is returned. Invalid
entries should display a message.
Assignment Number |
Assignment Name |
1 |
Access Database |
2 |
SQL |
3 |
Pseudocode |
4 |
Flowchart |
5 |
JavaScript code |
6 |
Visual Basic Code |
7 |
HTML |
- Problem #4: Write a program to write a file with three or four fields on it (different from the set I used).
- Problem #5: Then write a program to read the file and display it on the screen.