Code:
#include<iostream>
using namespace std;
struct Emp
{
int empid;
int hours;
double payrate;
double wage;
Emp *next;
}*head,*tail;
insert_node( int id)
{
if(head==NULL)
{
head=new Emp;
head->empid=id;
head->hours=0;
head->payrate=0;
head->wage=0;
head->next=NULL;
tail=head;
}
else
{
Emp *node=new Emp;
node->empid=id;
node->hours=0;
node->payrate=0;
node->wage=0;
node->next=NULL;
tail->next=node;
tail=tail->next;
}
}
void print_wages()
{
cout<<"\n---------------------------------\n";
cout<<"Employee\t\twages\n\n";
struct Emp *itr=head;
while(itr)
{
cout<<"Employee #"<<itr->empid<<"\t"<<"$
"<<itr->wage<<endl;
itr=itr->next;
}
}
void take_input()
{
struct Emp * itr;
itr=head;
while(itr)
{
double hr,pr;
cout<<"\nEnter the requested data for employee number
"<<itr->empid;
do
{
cout<<"\n\tHours worked:";
cin>>hr;
if(hr <0)
{
cout<<"invalid hours: Please reenter:\n";
}
}while(hr<=0);
itr->hours=hr;
do
{
cout<<"\n\tPay rate: $";
cin>>pr;
if(pr<15)
{
cout<<"Pay rate is less that 15 please reenter \n";
}
}while (pr<15);
itr->payrate=pr;
itr->wage=pr*hr;
itr=itr->next;
}
}
int main()
{
struct Emp * node;
char ch;
do
{
int id;
cout<<"\nEnter an employee ID number:";
cin>>id;
insert_node(id);
cout<<"\nDo you want to enter another one?";
cin>>ch;
}while(ch=='y'||ch=='Y');
take_input();
print_wages();
return 1;
}
Output:
C++ Linked Lists You have been hired by Employees. Inc to write an employee management system....
Program is to be written In C++, The output should look like the screen shot. It should allow the user to continue to ask the user to enter all employee ID's until done and then prompt the user to enter the hours and pay rate for each employee ID. Please help:( Can you please run the program to make sure the output is just like the screenshot please? It needs to have the output that is in the screenshot provided,...
C# please... Design a program that uses the following parallel arrays: empId: An array of seven Integers to hold employee identification numbers. The array should be initialized with the following numbers: 56588 45201 78951 87775 84512 13028 75804 hours: An array of seven Integers to hold the number of hours worked by each employee payRate: An array of seven Reals to hold each employee's hourly pay rate wages: An array of seven Reals to hold each employee's gross wages. The...
in C++ Write a program which uses the following arrays: empID: An array of 7 integers to hold employee identification numbers. The array should be initialized with the following values: 1, 2, 3, 4, 5, 6, 7. Hours: an array of seven integers to hold the number of hours worked by each employee. payRate: an array of seven doubles to hold each employee’s hourly pay rate. Wages: an array of seven doubles to hold each employee’s gross salary. The program...
I hope some one can help me with the Python excercise (coding) Design a program that uses the following parallel arrays: ● empId: An array of seven Integers to hold employee identification numbers. The array should be initialized with the following numbers: 56588 45201 78951 87775 84512 13028 75804 ● hours: An array of seven Integers to hold the number of hours worked by each employee. ● payRate: An array of seven Reals to hold each employee’s hourly pay rate....
C++ Program The Ward Bus Manufacturing Company has recently hired you to help them convert their manual payroll system to a computer-based system. Write a program to produce a 1-week payroll report for only one employee to serve as a prototype (model) for the administration to review. Input for the system will be the employee’s 4-digit ID number, the employee’s name, hours worked that week, and the employee’s hourly pay rate. Output should consist of the employee’s ID number, the...
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 JAVADesign a Payroll class with the following fields:• name: a String containing the employee's name• idNumber: an int representing the employee's ID number• rate: a double containing the employee's hourly pay rate• hours: an int representing the number of hours this employee has workedThe class should also have the following methods:• Constructor: takes the employee's name and ID number as arguments• Accessors: allow access to all of the fields of the Payroll class• Mutators: let the user assign values...
In header file (.h) and c++ file format (.cpp). A local company has asked you to write a program which creates an Employee class, a vector of Employee class objects, and fills the objects with employee data, creating a "database" of employee information. The program allows the user to repeatedly search for an employee in the vector by entering the employee's ID number and if found, display the employee's data. The Employee_C class should have the following data and in...
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...
java Payroll class Exceptions Programming Challenge 5 of Chapter 6 required you to write a Payroll class that calculates an employee’s payroll. Write exception classes for the following error conditions: • An empty string is given for the employee’s name. • An invalid value is given for the employee’s ID number. If you implemented this field as a string, then an empty string would be invalid. If you implemented this field as a numeric variable, then a negative number or...