• 100% Satisfaction Guarantee
.Paul, Computer Software Engineer
Category: Programming
Satisfied Customers: 44
Experience:  15 years visual basic experience
13558067
.Paul is online now

Design a program that uses the following parallel arrays empId

Design a program that uses the following parallel arrays:
•     empId: An array of seven integers to hold employee identification numbers. The array should be initialized with the following numbers:

56588          45201        78951        87775             84512        13028              75804
•     hours: An array of seven integers to hold the number of hours worked by each employee.
•     payRate: An array of seven Reals to hold each employee’s hourly pay rate.
•     Wages: An array of seven Reals to hold each employee’s gross wages.
The program should relate the data in each array through the subscripts. For example, the number in element 0 of the hours array should be the number of hours worked by the employee whose identification number is XXXXX in element 0 of the empId array. That same employee’s pay rate should be stored in element 0 of the payRate array
The program should display each employee number and ask the user to enter that employee’s hours and pay rate. It should then
Declare Integer empID(6)
empID(0) = 56588
empID(1) = 45201
empID(2) = 78951
empID(3) = 87775
empID(4) = 84512
empID(5) = 13028
empID(6) = 75804

Declare Integer hours(6)
Declare Decimal payRate(6)
Declare Decimal wages(6)

For x = 0 To 6
Display "Enter hours worked for employee: " & empID(x)
Input hours(x)
Display "Enter pay rate for employee: " & empID(x)
Input payRate(x)
wages(x) = hours(x) * payRate(x)
Next

For x = 0 To 6
Display "Employee number: " & empID(x) & " wages are \$" & wages(x)
Next
Customer: replied 8 years ago.
Looks good for me. Question Next stand for what? I haven't see this in the course I'm taking. This stand for display?
its part of the for...next loop

in this instance it iterating from 0 to 6, which means it loops 7 times.
Customer: replied 8 years ago.
Thanks a lot.
Customer: replied 8 years ago.

Have another one: I block myself in this one. Remember only psedocode not programm specific codes.

Design a program that generates a 7-digit lottery number. The program should have an Integer array with 7 elements. Write a loop that sets through the array, randomly generating a number in the range of 0 through 9 for each element. (Use the random function that was discussed in Chapter 6.) Then write another loop that displays the contents of the array.

try this:

Declare numbers(6)
For x = 0 to 6
Declare integer number
number = random (0-9)
numbers(x) = number
next
For x = 0 to 6
display numbers(x)
next

i'm going to have to sign off for the evening after this 1...
Customer: replied 8 years ago.
Thanks