Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ PROGRAMMING Parallel Arrays Write a program that calculates the weekly pay for a group of employees. Your program should do the following: 1. Declare

C++ PROGRAMMING

Parallel Arrays

Write a program that calculates the weekly pay for a group of employees. Your program should do the following: 1. Declare the following 4 parallel arrays, size 4. Names (String) hoursWorked (double) hourlyPay (double) WeeklyEarnings (double)

2. Use a for loop to prompt for the names, hours worked and hourly pay for the 4 employees. Example Output: Please enter name #1: John Please enter the number of hours worked: 10 Please enter the hourly pay rate: 12.50 Please enter name #2: Jane Please enter the number of hours worked: 20 Please enter the hourly pay rate: 15.50

3. Use a for loop to calculate the total earnings for each employee and store the results in the WeeklyEarnings array.

4.Use a for loop to display the results as follows: Name Hours Worked Hourly Pay Weekly Earnings -------------------------------------------------------- John 10 $12.50 $125.00 Jane 20 $15.50 $310.00 Mike 15 $10.00 $300.00 Carol 30 $13.00 $390.00

5. Extra Credit Declare a global constant to represent the size of the arrays. Use functions to complete steps 2,3 and 4. Use the following function prototypes: GetInfo(string[], double[], double[]): void CalculateWeeklyEarnings(double[], double[], double[]): void DisplayInfo(string[], double[], double[], double[]): void

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

Step: 3

blur-text-image

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

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

What do you think of the MBO program developed by Drucker?

Answered: 1 week ago

Question

=+Do you want to work from home?

Answered: 1 week ago

Question

=+ What skills and competencies will enable someone

Answered: 1 week ago

Question

=+to live and work wherever he or she wants?

Answered: 1 week ago