Visual Basic 6.0 Guide
Select Case Tasks

1. Write a program which allows the user to input the number of a month (from 1 to 12). Your program should tell them how many days are in that month.

2. Write a program that tells a tired old teacher what grade to give a student's work. The teacher should input a number from 0 to 100. Marks below 40 are graded fail, marks from 40 to 59 are graded pass. 60 or more marks will earn a merit and 80 or more scores a distinction.

3. Write a program to calculate the weekly pay of an employee. The user enters the number of hours of normal time worked in the week. They select their hourly rate from a list box. They also enter the number of hours of overtime worked. Overtime is paid at double the hourly rate.

wages program form design

You will only need to calculate overtime if the checkbox (the one containing a tick in the screenshot) has been checked. When a checkbox is checked, it has the value 1. When it is unchecked, it has the value 0.

For example,

If chkOvertime.value = 1 Then
{Calculate the overtime}
End If

A well-designed program would only allow a user to enter overtime hours if they have worked overtime (ie ticked the box). There is more than one way to achieve this. You could change the visible property (true or false) of the textbox when the user ticks or unticks the overtime box. You can also enable and disable a text box (and any other control) by setting the enabled property to true or false.

There are a lot of things to program here. Try to complete the solution bit by bit, testing small parts of your program to make sure that you are on the right track.