Question: Convert pseudocode into Visual Basic code 1 // Constant for the size of the array. 2 Constant Integer SIZE = 6 3 4 // Array

Convert pseudocode into Visual Basic code
1 // Constant for the size of the array.
2 Constant Integer SIZE = 6
3
4 // Array to hold each employee's hours.
5 Declare Real hours[SIZE]
6
7 // Variable to hold the hourly pay rate.
8 Declare Real payRate
9
10 // Variable to hold a gross pay amount.
11 Declare Real grossPay
12
13 // Variable to use as a loop counter.
14 Declare Integer index
15
16 // Get each employee's hours worked.
17 For index = 0 To SIZE - 1
18 Display "Enter the hours worked by"
19 Display "employee ", index + 1, "."
20 Input hours[index]
21 End For
22
23 // Get the hourly pay rate.
24 Display "Enter the hourly pay rate."
25 Input payRate
26
27 // Display each employee's gross pay.
28 Display "Here is each employee's gross pay."
29 For index = 0 To SIZE - 1
30 Set grossPay = hours[index] * payRate
31 Display "Employee ", index + 1, ": $",
32 currencyFormat(grossPay)
33 End For
Programs output should be:
Enter the hours worked by employee 1
10 [Enter]
Enter the hours worked by employee 2
20 [Enter]
Enter the hours worked by employee 3
15 [Enter]
Enter the hours worked by employee 4
40 [Enter]
Enter the hours worked by employee 5
20 [Enter]
Enter the hours worked by employee 6
18 [Enter]
Enter the hourly pay rate.
12.75 [Enter]
Here is each employee's gross pay.
Employee 1: $127.50
Employee 2: $255.00
Employee 3: $191.25
Employee 4: $510.00
Employee 5: $255.00
Employee 6: $229.50

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!