Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help finish a C++ code this is what a have so far #include #include #include #include using namespace std; ofstream print(salary.out); ifstream ins(salary.txt); //prototype

image text in transcribedneed help finish a C++ code

this is what a have so far

#include #include #include #include using namespace std;

ofstream print("salary.out"); ifstream ins("salary.txt");

//prototype function declaration void display_heading(); void read_data(string&, double&); void compute_salary(double, double&, double&, double&); void display_result(string, double, double, double, double);

void find_max(string, double, string&, double&); void find_min(string, double, string&, double&); void display_max(string, double); void display_min(string, double);

int main() { string name, maxname, minname;

double salary, tax_paid, hours, net_pay, max_pay=-9, min_pay=99999.; display_heading();

//employee One read_data( name, hours); compute_salary( hours, salary, tax_paid, net_pay); display_result(name, hours, salary, tax_paid, net_pay); find_max(name, net_pay, maxname, max_pay); find_min(name, net_pay, minname, min_pay); //employee Two read_data( name, hours); compute_salary( hours, salary, tax_paid, net_pay); display_result(name, hours, salary, tax_paid, net_pay); find_max(name, net_pay, maxname, max_pay); find_min(name, net_pay, minname, min_pay); //employee Three read_data( name, hours); compute_salary( hours, salary, tax_paid, net_pay); display_result(name, hours, salary, tax_paid, net_pay); find_max(name, net_pay, maxname, max_pay); find_min(name, net_pay, minname, min_pay); display_max(maxname, max_pay); display_min(minname, min_pay);

//employee four read_data( name, hours); compute_salary( hours, salary, tax_paid, net_pay); display_result(name, hours, salary, tax_paid, net_pay); find_max(name, net_pay, maxname, max_pay); find_min(name, net_pay, minname, min_pay);

ins.close(); print.close(); cout

- Write a program, which accepts name and number of hours worked per week of an employee and computes weekly salary of the employee. The program, also, calculates income tax (15%) and net wage of the employee. The rate per hour over 40 is one and half times the normal rate ($10/ hour ). The program will display the highest and lowest salary holder's record. Your program will produce an output file named salaryEmp.txt. - read data compute salary, show result. - read data will accept name and hours worked - compute salary computes weekly salary, income tax paid, and net wage: - show result will display name, hours, salary, tax paid, and net wage of the employee in a table. - The program will use a data file as shown below: - Sample output of the program is: Ronnie Zamora is holding the largest salary of 40375 Rudy Miller is holding the lowest salary of 127.50 Press any key to continue

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

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

Students also viewed these Databases questions

Question

Discuss the states of accounting

Answered: 1 week ago

Question

7. It is advisable to do favors for people whenever possible.

Answered: 1 week ago

Question

9. Power and politics can be destructive forces in organizations.

Answered: 1 week ago