Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

1. What are the major sources of stress in your life?

Answered: 1 week ago

Question

What tools might be helpful?

Answered: 1 week ago