Written in C)   Create a payroll program to store and calculate the payroll for a small company as follows: Create an array of floats that is 4 rows and 50 columns, with the columns being the number of employee records stored in the array. Program parameters are as follows: Create a menu in a function menu and call it with the following options (use a do-while loop): A or a to add employee info D or d to display employee info T or t to display total payroll S or s to display the info of all employees C or c to display the count of employees present in the array F or F to delete a record Z or z to exit program The information for each employee is: employee number, hours worked, pay rate per hour, tax deduction. Option A or a: Call the function possible to check and if the index returned is 50 then output a msg saying that the array is full. If the index returned is less than 50 the call the function add, pass to it the available index as the third argument and the function will ask the user for one employee information at a time and store it in that column index. Please enter employee number: 2190 Please enter hours worked: 32.50 Please enter pay rate: 9.25 Please enter tax rate deduction: 5.50 Option D or d: ask the user for an employee number as integer. Call the function search and if the function returns 1000, output a msg. indicating “no such employee”. If the function returns a number                 other than 1000, then call function record and pass the index returned from search to it that will output all the employee information stored in addition to the calculated deduction and salary. Output sample: Info for employee number: 2190 Hours worked: 32.50 Pay rate: $ 9.25 Total earned: $ 300.63 Tax deduction: 5.50 % for an amount of $ 16.53 Paycheck: $ 284.09 Option T or t: calculate and return the sum of the total for the paychecks of all employees. Call function paycheck and output the return of the function in a formatted statement. Option F or f: to delete an employee record. Get the employee number from the user and call function search to find out if the employee is in the array and what column index is the employee in. Then call function Delete on that index if the employee is in the array and if not, output a msg. saying no such employee. Option S or s: display the information for all employees in the same format as in option D one employee at a time separated by a line of ------, by calling the function record on each column index that has an employee. Option C or c: Output the number of employees in the array. Use the function count. Option Z or z: exit the program. use all these functions in the program. Functions: cat[][50] is an array parameter n is an integer parameter for the number of rows int possible(float cat[][50], int n); // function checks if an array element is empty for an employee record to be added. Returns the first free index in the array available to add employee (dynamic scan). If index returned is 50 then the array is full. void add(float cat[][50], int n, int m); // function used for adding employee. int search(float cat[][50], int n, int mouse); // function returns the index where employee number stored in mouse is located. Returns 50 if there is no such employee. int count(float cat[][50], int n); // function returns the number of employee records present in the array

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
(Written in C)
 
Create a payroll program to store and calculate the payroll for a small company as follows:
Create an array of floats that is 4 rows and 50 columns, with the columns being the number of employee
records stored in the array.
Program parameters are as follows:
Create a menu in a function menu and call it with the following options (use a do-while loop):
A or a to add employee info
D or d to display employee info
T or t to display total payroll
S or s to display the info of all employees
C or c to display the count of employees present in the array
F or F to delete a record
Z or z to exit program
The information for each employee is: employee number, hours worked, pay rate per hour, tax
deduction.
Option A or a:
Call the function possible to check and if the index returned is 50 then output a msg saying that the
array is full. If the index returned is less than 50 the call the function add, pass to it the available index as
the third argument and the function will ask the user for one employee information at a time and store
it in that column index.
Please enter employee number: 2190
Please enter hours worked: 32.50
Please enter pay rate: 9.25
Please enter tax rate deduction: 5.50
Option D or d: ask the user for an employee number as integer. Call the function search and if the
function returns 1000, output a msg. indicating “no such employee”. If the function returns a number
 
 
 
 
 
 
 
 
other than 1000, then call function record and pass the index returned from search to it that will output
all the employee information stored in addition to the calculated deduction and salary.
Output sample:
Info for employee number: 2190
Hours worked: 32.50
Pay rate: $ 9.25
Total earned: $ 300.63
Tax deduction: 5.50 % for an amount of $ 16.53
Paycheck: $ 284.09
Option T or t: calculate and return the sum of the total for the paychecks of all employees. Call function
paycheck and output the return of the function in a formatted statement.
Option F or f: to delete an employee record. Get the employee number from the user and call function
search to find out if the employee is in the array and what column index is the employee in. Then call
function Delete on that index if the employee is in the array and if not, output a msg. saying no such
employee.
Option S or s: display the information for all employees in the same format as in option D one employee
at a time separated by a line of ------, by calling the function record on each column index that has an
employee.
Option C or c: Output the number of employees in the array. Use the function count.
Option Z or z: exit the program.
use all these functions in the program.
Functions: cat[][50] is an array parameter n is an integer parameter for the number of rows
int possible(float cat[][50], int n); // function checks if an array element is empty for an employee
record to be added. Returns the first free index in the array available to add employee (dynamic scan). If
index returned is 50 then the array is full.
void add(float cat[][50], int n, int m); // function used for adding employee.
int search(float cat[][50], int n, int mouse); // function returns the index where employee number
stored in mouse is located. Returns 50 if there is no such employee.
int count(float cat[][50], int n); // function returns the number of employee records present in the
array
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

the code comes back with this error

error: expected declaration or statement at end of input
Transcribed Image Text:error: expected declaration or statement at end of input
Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education