Programming Exercise 4.12
The Payroll Department keeps a list of employee information for each pay period in a text file. The format of each line of the file is the following: <last name> <hours worked> <hourly wage>
Write a program that inputs a filename from the user and prints to the terminal a report of the wages paid to the employees for the given period.
An example of the program input and output is shown below:
Enter the file name: data.txt Name Hours Total Pay Lambert 34 357.00 Osborne 22 137.50 Giacometti 5 503.50
Note: Could you plz go through this code and let me
know if u need any changes in this.Thank You
_________________
// data1.txt
Lambert 34 357.00
Osborne 22 137.50
Giacometti 5 503.50
_______________________
#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
using namespace std;
int main() {
ifstream dataIn;
string filename, name;
int hours;
double totPay;
cout << "Enter the input filename :";
cin >> filename;
//Open the input file
dataIn.open(filename.c_str());
//checking whether the file name is valid or not
if (dataIn.fail()) {
cout << "** File Not Found **";
return 1;
} else {
cout << setw(20) << left << "Name" <<
setw(10) << left << "Hours" << setw(10) <<
left << "Total Pay" << endl;
while (dataIn >> name >> hours >> totPay) {
cout << setw(20) << left << name <<
setw(10) << left << hours << setw(10) <<
left << totPay << endl;
}
dataIn.close();
}
return 0;
}
___________________________
Output:

_______________Could you plz rate me well.Thank
You
Programming Exercise 4.12 The Payroll Department keeps a list of employee information for each pay period...
The Payroll Department keeps a list of employee information for each pay period in a text file. The format of each line of the file is the following: <last name> <hourly wage> <hours worked> Write a program that inputs a filename from the user and prints to the terminal a report of the wages paid to the employees for the given period. The report should be in tabular format with the appropriate header. Each line should contain: An employee’s name...
The Payroll Department keeps a list of employee information for each pay period in a text file. The format of each line of the file is the following: Write a program that inputs a filename from the user and prints to the terminal a report of the wages paid to the employees for the given period. The report should be in tabular format with the appropriate header. Each line should contain: An employee’s name The hours worked The wages paid...
I am having a hard time with my program to assignment 4.12. Here
are the instructions:
The Payroll Department keeps a list of employee information for
each pay period in a text file. The format of each line of the file
is the following: <last name> <hours worked> <hourly
wage>
Write a program that inputs a filename from the user and prints
to the terminal a report of the wages paid to the employees for the
given period.
The report...
You are to write a program that will process employees and their pay. For each employee the program will read in an employee’s name and hourly pay rate. It should also read in the number of hours worked each day for 5 days and calculate his or her total number of hours worked. You must read the hours using a loop. The program should output the employee’s name, gross pay, total withholding amount and net pay. Withholding is made up...
In C++ Please please help.. Assignment 5 - Payroll Version 1.0 In this assignment you must create and use a struct to hold the general employee information for one employee. Ideally, you should use an array of structs to hold the employee information for all employees. If you choose to declare a separate struct for each employee, I will not deduct any points. However, I strongly recommend that you use an array of structs. Be sure to read through Chapter...
In C program Consider a file that contains employee records, called "empstat.txt." The data for each employee consist of the employee’s last name (up to 20 characters), employee id number (up to 11 characters), gross pay for the week (double), taxes deducted (double) for the week, and net pay (double) for the week. Create a struct to hold the employee information. Write a void function called writeEmpFile that prompts the user to enter last name, id number, gross pay and...
JAVA Programming . Description: For an unknown number of employees: prompt and receive payroll data; calculate gross pay, taxes owed, and net pay; and display a pay stub. Input : Prompt and receive input from the user for the following: /// Employee’s First and Last Name /// Hours Worked /// Pay Rate /// Overtime Rate Multiplier ** For the Employee’s First and Last Name: Both data items must be read in one prompting into one...
in
csis 152 style
python programming language
Read the initial employee information from a text file and store the employee information into a list of sublists called empRoster. Each sublist should contain [empID, name, payrate,hours] Here's an example of how empRoster will look: 111, "Sally Smith", 10, 401, 1222, "Bob Brown", 10, 42]1 The text file will be structured as shown below, where each line contains the employee id, employee name, payrate and hours. Each entry on the line is...
PYTHON PROGRAMMING LANGUAGE (NEEDED ASAP)
Using a structured approach to writing the program: This section will guide you in starting the program in a methodical way. The program will display a window with GUI widgets that are associated with particular functions: Employee Payroll O X -- - - - - - - - - - - Show Payroll Find Employee by Name Highest Lowest Find Employee by Amount Write Output to Fie Cancel - -------- ------------- Notice that some of...
(PL/SQL Programming) Consider the table EMPLOYEE with attributes ID, Name, and Hours, and the table PAYINFO with attributes Regular, Overtime, and HourLimit, defined and populated by the following script: DROP TABLE EMPLOYEE CASCADE CONSTRAINTS; CREATE TABLE EMPLOYEE ( ID CHAR(5), Name VARCHAR2(16), Hours NUMBER(2), CONSTRAINT PK_EMPLOYEE PRIMARY KEY (ID) ); INSERT INTO EMPLOYEE VALUES ('22144', 'Anderson', 30); INSERT INTO EMPLOYEE VALUES ('31902', 'Bruford', 45); INSERT INTO EMPLOYEE VALUES ('42771', 'Wakeman', 20); INSERT INTO EMPLOYEE VALUES...