Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Spring 2017 CMSC 140 Programming Project 7: Payroll 1. Working with arrays 2. Using file operations 3. Using a selection sort to sort parallel arrays

image text in transcribed
image text in transcribed
image text in transcribed
Spring 2017 CMSC 140 Programming Project 7: Payroll 1. Working with arrays 2. Using file operations 3. Using a selection sort to sort parallel arrays 4. Using a binary search with sorted arrays 5. Using a sequential (linear) search with unsorted arrays 6. Implementing functions besides function main) Write a C++ program that processes a payroll. Your program will calculate the wages for each employee, given the number of hours worked and the payrate per hour. It will search for two employees by number, one with a binary search (see page 462) and one with a linear search (see page 459). A selection sort (see page 476) will sort the arrays so that the employee numbers are in ascending order. Input for this project has two sources. The user must enter the names of the input and output files from the keyboard. The user will enter two employee numbers from the keyboard in response to prompts. The input file should have one line for each employee with the 3 required items: employeeID, hoursWorked, and payRate (separated by hitespace on the file) The last line of the file must always have only -1 Output also has two sources. The program title and the programmer name should appear on both the console and the file. If the input file does not open, an error message should appear on the console and no attempt should be made to open the output file for any output or processing. The message "Processing complete" should appear on the console after the programmer name and just before the main program ends (make it the last statement before "return;"). The console output will show the prompts with the search numbers. The file output should show the unsorted table of the input items with the wages, followed by the sorted table with the same 4 columns. The column numbers with decimal amounts should line up on the decimal point under the column headings. Processing Requirements Your program should use the following one-dimensional arrays: empId: an array of long integers to hold employee identification numbers. Assume there will be no more than 20 identification numbers, but your code should check that the file doesn't attempt to enter more. If an attempt is made to enter 21, process only the first 20 hours: an array of doubles to hold the number of hours worked by each employee. Fractional hours are possible. payRate: an array of doubles to hold each employee's hourly pay rate. wages: an array to hold each employee's gross wages

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

Beginning VB.NET Databases

Authors: Thearon Willis

1st Edition

1594864217, 978-1594864216

More Books

Students also viewed these Databases questions