Second class notes :05/31/06

Assignment is on page 51 of the text book.:

2A) Compute gross pay for each employee by interactively entering hours worked and hourly rate.

    The following is the sample input and output for Phase 2A:

        ENTER EMPLOYEE ID: 5678

        ENTER HOURS WORKED: 40

        ENTER HOURLY RATE: $15.00

       

        YOUR ID IS : 5678

        YOUR HOURS WORKED: 40

        YOUR HOURLY RATE IS: $15.00

        YOUR GROSS PAY IS: $600.00

2B) Compute net pay for each employee by applying a fixed tax rate of 10%. You must enter each employee's id.( Enter only last four digits of SSN at this time.)

    Sample input and output for Phase 2B:

        ENTER EMPLOYEE ID: 5678

        ENTER HOURS WORKED: 40

        ENTER HOURLY RATE: $15.00

       

        YOUR ID IS: 5678

        YOUR HOURS WORKED IS: 40

        YOUR HOURLY RATE IS: $15.00

        YOUR GROSS PAY IS: $600.00

        YOUR TAX RATE IS: 0.10

        YOUR TAX AMOUNT IS: $60.00

        YOUR NET PAY IS: $540.00

Visual Basic Hints:

msgBox("ENTER EMPLOYEE ID")

Steps to go to the form:

StartAll ProgramsMicrosoft Visual Studio.Net2003Microsoft Visual Studio.Net2003

 

 

 

 

One way to display in Visual Basic is to use  msgBox  in contrast to cout in C++.

cout<<"HELLO";

Next construct after msgBox is inputBox which displays a message  and wait for the user  to enter an input value and assign the input value to a name (variable name or textbox).

A variable name must be declared ahead of time as particular data type such integer, float, string, double, character etc...

employeeid=inputBox ("ENTER EMPLOYEE ID")

How to 'declare' a variable?

Dim employeeid as integer it should be before employeeid=inputBox ("ENTER EMPLOYEE ID")