C++ :: Payroll Program Of A Company That Have At Least 5 Employees
Oct 1, 2014
Make a c++ program of the payroll of a company
input values :
a. Name of Employee
b. Position in the company
c. No. of hours worked
d. No. of overtime hours
e. rate per hour
formula:
basic pay = number of hours worked x rate per hour
ot pay = overtime hours x 150% of rate per hour
gross pay = basic pay + ot pay
tot deduc = tax + sss + med
tax can be computed based on the following table:
basic pay tax
10000 or less 1% of basic pay
10001-15000 2% of basic pay
15001-20000 3% of basic pay
20001-30000 4% of basic pay
30001 or more 5% of basic pay
sss = 10% of basic pay
med = 6% of basic pay
net pay= gross pay - total ded
*The payroll should have at least 5 employees in it.*
View 11 Replies
ADVERTISEMENT
Jun 9, 2014
This program in not completed. I am creating a large program in order to calculate a company's weekly payroll. For now I am filling in the separate functions piece by piece before the rest of the program is completed.
Right now I am trying to use separate functions to call other functions. I need to ask the user for the file name and then open the file. I am no longer getting any compiler errors however when I run the program all it displays is "Welcome."
So it's not actually calling the NameTheFile function and the OpenTheFile function. It just says "Welcome" and then closes down. Why is it doing this?
/*Program to determine company's weekly payroll*/
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
void NametheFile() {
ifstream inputFile;
[Code] ....
View 1 Replies
View Related
Dec 5, 2013
My colleague and I have been given a task to create a list with the employes of a company using binary trees. Each employee/node has to contain the following information:
- Employe name
- Rank
- ID Number
- monthly Salary
We have to write a C program (using Codeblocks) which builds the company tree with the information above and afterwards lists all the employes who have a salary bigger then a number specified by the user.
So far so good. We've had a look on the examples on the internet and after finding one which looked friendly enough we started working on that one to suit our needs. Credits for the original source code to: C Program to Implement Binary Search Tree Traversal - Basic C Programs | C Programming Examples
We've reached the point where we're able to insert the required information but being able to list all the employes who's salary is bigger then the number given by the user seems to be rather difficult to achieve. I'll include the code next. We have left almost the entire pieces of the original code and we are aware that the are still things which are not required for our assignment, which only requires to enter the 4 information above and afterwards display the employes with the before mentioned condition concerning their salary.
Code:
# include <stdio.h>
# include <conio.h>
# include <stdlib.h>
typedef struct BST
[Code] .....
View 1 Replies
View Related
Jan 14, 2015
I'm trying to get this program to return total taxi cab fair an infinite number of times, however, when I use the while statement after for and try to run the program, it just keeps displaying the first total fair rapidly.
specifications:A cab company needs a program to calculate the cost of a cab ride.
The driver will enter the length of the trip in miles.
The miles entered must be greater than 0.
Create a function to calculate the charge. The function should receive one argument, the length of the trip, and should return the total fare for the ride.
The taxi charges a fixed charge of $2.50, plus an additional charge of $1.85 per mile.
Allow the user to calculate any number of trips.
At the end display the total of all the fares.
here is my code:
#include <iostream>
#include <iomanip>
using namespace std;
//function prototypes
double getLength ();
int main () {
[code]....
View 3 Replies
View Related
Aug 25, 2014
You are required to write a program for a Used Car Dealer company. In the system you need to maintain the cars’ inventory and details. Each car in the company contains the following details:
• Car Registration Number
• Car Make or Brand
• Car Model
• Car Colour (eg. Silver, Black , Red)
• Year of manufacturing (The year the car was manufacture)
• Engine Capacity (in cc)
• Transmission (manual or automatic)
• Cost of the car (SGD)
The Car Registration Number is in the format of AAA1234 or AA1234A or A1234A which is accordance to the Malaysia car registration format. The A alphabet is in accordance to the registration number for respective in Singapore. (eg. AEW9829 or W1212Y or MCD1177). Note the A and the 1234 total count in the registration number can be less than 3 like AT9829 or BHY280. The Car Make is for the identifying the manufacturer of the car like Honda, Toyota, Proton..etc. The Car Model is to represent the Manufacturers’ respective model like Honda City, Honda Civic, Honda Accord, Toyota Vios, Toyota Camry … etc.
You are required to create menu and operations for:
1) Create a new Car account
2) Edit existing Car account details
3) Remove a car account from the system
4) Search for cars in the system (based on Car Make, Model, Year of manufacturing or Price)
5) Check total inventory in the system
View 1 Replies
View Related
May 15, 2014
My objective is to write a payroll program that among other things sorts the net pay by using pointers. I've already written most the program and have written a working program that sorts the net pay just not by pointers. So What I'll be posting below is my program so far without the pointer sort function.
What I need to do to finish my program is figure out how to add pointers to sort net pay into it.
#include <iostream>
#include <fstream>//file input output stream
#include <iomanip>
#include <string>
using namespace std;
//function prototypes
int readalldata(long int id[], string fname[], string lname[], int hoursworked[], float hourlyrate[], int n);
[Code] ....
View 14 Replies
View Related
May 22, 2014
I'm working on a payroll program and I'm having problems that are causing calculation errors.
My input file is
1234FredJones4025.00
2345 TerrySmith6010.00
The errors I get are from the regular pay, over time pay, gross pay, tax amount and net pay calculations. They all look similar to this (6e+002). I believe they are occurring because regular pay isn't calculating correctly and the rest depend on that for their calculations. However, I can't see why regular pay isn't calculating correctly.
#include <fstream>
#include <iostream>
#include <iomanip>
using namespace std;
class payroll{
ifstream fin;
char employeeid[100];
[Code] .....
View 14 Replies
View Related
Sep 30, 2013
getting output from my code when I compile, the codeblocks ide doesnt show any errors it just doesn't give me any out put when I compile?
Here is my code:
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
//
//CLASS DECLARATION SECTION
[code].....
View 1 Replies
View Related
Nov 25, 2013
The program is showing zero in output section ....
Code:
#include <iostream>
#include <cstdio>
#include <fstream>
#include <string>
#include <iomanip>
using namespace std;
const int SZ = 55;
[Code] ....
The output:
Code:
First Last Employee Hours Rate Regular Overtime Gross
Name Name Number Worked of Pay Pay Pay Pay
==============================================================
Jane Adams A1234 40.00 10.00 0.00 0.00 0.00
Mary Lincoln L8765 50.00 10.00 0.00 0.00 0.00
Martha Washington W7654 25.50 10.85 0.00 0.00 0.00
John Adams A9876 52.00 15.75 0.00 0.00 0.00
George Washington W1235 45.00 25.00 0.00 0.00 0.00
Abraham Lincoln L9087 40.25 55.00 0.00 0.00 0.00
William Tell T9876 30.00 9.75 0.00 0.00 0.00
View 12 Replies
View Related
Oct 5, 2014
Write a payroll program that prompts for the number of hours an employee worked, as well as the employee’s pay rate. If the employee worked for 40 hours or less, the gross pay is calculated by multiplying the number of hours worked by the pay rate. If the number of hours worked by the employee exceeds 40 hours, the employee should receive regular pay for the first 40 hours, and receive time-and-a-half pay for the hours in excess of 40. Display the calculated gross pay on the screen.
Continue to prompt for similar data for more employees and have the gross pay of each employee displayed, until there is no more employee data to process. Then display “Good Bye”.
Your solution must be separated into three source files (Interface, Implementation, and Test)
View 3 Replies
View Related
Dec 11, 2013
I am writing a employee payroll program using structures. My program is running but its only showing some of the data.
HERES MY CODE
Code:
#include <iostream>
#include <cstdio>
#include <fstream>
#include <string>
#include <iomanip>
#include <cstring>
using namespace std;
const int SZ = 20; // size of arrays to hold scores
struct payrollStruct {
[Code] ....
And it doesn't show anything from txt file
Code:
40.0 10.00 A1234 Jane Adams
50.0 10.00 L8765 Mary Lincoln
25.5 10.85 W7654 Martha Washington
52.0 15.75 A9876 John Adams
45.0 25.00 W1235 George Washington
[Code] .....
View 14 Replies
View Related
Apr 22, 2014
I have to make a table for 10 Employees to look like this:
Employee ID Gross Pay Net Pay
101 540.58 480.80
158 796.32 630.20
How can I do this? This is my code so far.
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
void get_emp_rec(int &id, double &prate, double &hours) {
[Code] ....
View 2 Replies
View Related
Aug 5, 2013
The question involves me writing a program using a overloaded function to calculate the Weekly rate of employees but they get paid hourly and weekly. I get this error but do not know why,
#include <iostream>
using namespace std;
int calcWeeklyPay(int paidWeekly, int annualSalaryWeekly)
//Returns the Weekly salary of weekly paid Employees
int calcWeeklyPay(int paidHourly, int annualSalaryHourly)
//Returns the Weekly salary of Hourly paid Employees
[Code]...
View 3 Replies
View Related
Dec 11, 2013
I'm writing a code that's suppose to do a payroll for my intro cs class. At first it was working fine until I had to add the part that made sure a user couldn't enter a wage value below $6.00 and now it stops the loop right after that part for some reason.
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int const HR = 7;
[Code] ....
View 2 Replies
View Related
Jul 1, 2014
Build a class named "salesCompany". Save it's name with a string and an array with records which will be filled with values from sales in different cities of the company.
Build the constructor which must get as a parameter the name of the company and a text file which will fill the array. There is an example of the text file format. Every line saves the sold quantity of a product, identified by a code, in a certain city.
CodeCityQuantity
1a63bCity11200
45ab8City2550
#include <iostream>
#include <string.h>
using namespace std;
class salesCompany {
[code].....
what should I add more and how can make it available for the user to enter as an input a text file.
View 1 Replies
View Related
May 13, 2013
I have to obtain a check number from a datafile and then also get company information also from a datafile.
So my first question is about the:
Code:
char outputFilename[]= "out.list"
Is this the name of the output file I'm going to write to? And also the file has to be created before being used...is that line of code creating the file or do i have to create it in notepad?
Code:
FILE *ifp, *ofp;
char *mode = "r";
char outputFilename[] = "out.list";
ifp = fopen("in.list", mode);
if (ifp == NULL) {
fprintf(stderr, "Can't open input file in.list!
[Code] .....
View 7 Replies
View Related
Feb 13, 2014
You are writing a program to calculate the area for 500 different measurements for a playground company in the region. The company must calculate square footage of each prospective playground, as well as the total cost to mulch each area. The cost of mulch changes frequently, so the company would like to be able to input the current cost per square foot of mulch each time they run the program. Since the quantity of data is large, the input should come from a file called “measurements.txt”. You can assume the file includes the length of each prospective playground, followed by the width. The file will be in the following format.
450300
120210
.
.
.
Ask the user the name of the file they would like to write to, as well as the current price of mulch per square foot. Output the area of each playground, along with the total price of mulch to the file that the user specifies. The playground company would like each column of output to be 20 characters in width. Each column should have an appropriate heading in the output file. You should format your output data appropriately. For example, for the input data displayed above, along with a $2.00 per square foot mulch price, the output would be:
Area Total Mulch Price
135000 $270000.00
25200 $50400.00
View 3 Replies
View Related
Dec 15, 2014
You work for a painting company. Your job is to calculate the amount of paint needed for every contract assigned to the company. This time, you need to paint an outside wall. The dimensions of the wall are 5 X 7m. The window is a circle with the radius of 1m. Write a program that would calculate the following:
The amount of paint needed knowing that you need 1 gallon per 10 square meters. The amount of time to complete the job knowing that it takes 1 hour per 10 square meters to prepare the surface, 5 minute per square meter to pant it and 5 minute per square meter to clean up the area.
View 8 Replies
View Related
Mar 27, 2013
Summary: 6 companies have a product in 5 different warehouses. Each company is identified by a positive ID number and each warehouse is identified by a number (1 for the first, 2 for the second,…)
Object: the object of this assignment is to write a C++ program which asks the user to enter a company ID number, and the number of products in each of the warehouses. It then computes and prints the total number of products for that company
If the total number of product is less than 100, it prints the message “place a new order”
Input: for each company, its ID, and the number of products in each warehouse with appropriate prompt messages.
Example: Enter company ID number: 101
Enter number of products in warehouse #1:30
Enter number of products in warehouse #2:60
Enter number of products in warehouse #3:0
Enter number of products in warehouse #4:5
Enter number of products in warehouse #5:27
The total for company 101 is:122
Output: for each company, the total number of product, and the message “place a new order” if the total number of product is less than 100.
Method:
1. Define global variable, int total_prod to hold the total number of products for a company
2. define the function void compute_total() that uses a loop to read the number of the products in all warehouses for one company, computer the total number of products and store it into the global variable total_prod.
3. Define the function void new_order() that determines if a new order need to be placed as follows: if the total number of products (in the global variable total_prod) is less than 100, it prints the message “place a new order”
4. Your function main does the following in a loop:
- read a company ID number
- call function compute_total() to read the number of the product in all warehouses for that company, and to compute their sum
- print the total number of the product for that company with an appropriate message
- call the function new_order() to determine if a new order need to be placed.
View 17 Replies
View Related
May 15, 2014
Alright, after what seems like forever I'm on the last stage of modifying my Payroll Program. This time I have to sort using pointers and I only have to sort the Net Pay category.
Using one of my earlier programs I've removed content from it until it's in a state where it runs but contains no sorting functions.
So now I've to a working program that lacks any kind of sorting and looks like this.
#include <iostream>
#include <fstream>//file input output stream
#include <iomanip>
#include <string>
using namespace std;
//function prototypes
int readalldata(long int id[], string fname[], string lname[], int hoursworked[], float hourlyrate[], int n);
[Code] .....
My hints for how to add pointers to the program are...
int *np,tmp;
for (i=0,i<n; i++) np=&netpay[i]; //associating the netpay to np;
temp=np[i];//storing the pointer to a temp
I've been fooling around trying to sort the Net Pay by pointers using these hints for a bit now and I'm still not getting it.
View 2 Replies
View Related
Apr 28, 2014
how these structures and arrays work which is why although I added alot more code than given, I sent it into my teacher and he was puzzled with my project. So I brought it back to a payroll calculator unsorted.
Sort the payroll data, and output the data to the file in order by gross pay (lowest to highest)
#include <fstream>
#include <iostream>
#include <cstdlib>
[Code]....
View 5 Replies
View Related
May 20, 2014
Define a PayRoll class that has data members for an employee's hourly pay rate (an integer , representing cents) and number of hours worked (also an integer ). The class provides two member functions, setRate and setHours that assign the value of their parameter to the appropriate data member. The class provides a third member function, getPay, that returns weekly gross pay (in cents), computed as follows: hours times rate for the first 35 hours plus hours times rate times one and a half for any hours past 35.
View 3 Replies
View Related
Apr 11, 2014
When you execute my code you'll notice the regular pay for the first example will calculate to $500 when it is only supposed to calculate to $400. I'm also having a problem adding up the totals of the regular pay and overtime pay to get a total payroll which is displayed in one cout statement. 95% of my code is correct, I'm just having these two issues. To make it more clear hear is my assignment:
The regular working hour for an employee is 40 hours a week. Sometimes employees work over time. When the employee works 40 or less hours, the regular pay is calculated as number of hours worked times the hourly rate. When the employee works over time i.e. beyond 40 hours then the employee's pay has two components a) regular pay (40 hours X hourly rate), and 2) overtime pay (the overtime hours beyond 40 X time and half of the hourly rate).
void compute(incomeInfo *ptrI, int count) {
for (int i = 0; i<count; i++)
if (ptrI->hours <= 40) {
ptrI->regPay = ptrI->hours * ptrI->hRate;
ptrI++;
[Code] ....
View 1 Replies
View Related
Dec 9, 2014
The purpose of this code is to calculate a pagecheck for intered hours and overtime for any hours over 40! This is what I have so far!
#include<iostream>
using namespace std;
void Amount (int hours, int wage, int sum);
void printCheck(int sum);
int main()
[code]....
View 1 Replies
View Related
Apr 27, 2014
I have been given a HW to write code for a payroll system. The base class would be Employee. There are four types of employees.
1 - Salaried (fixed salary, no matter the hours)
2 - Hourly (overtime [>40 hours] pays time and half)
3 - Commissioned (paid percentage of sales)
4 - Base-plus-commissioned (base salary + percentage of sales)
Also add a private data member birthDate (a Date object) and departmentCode, an int to class Employee.
1 - Is the following hierarchy that I'm visualizing right? Or is a change needed?
Here is the link: [URL] ....
2 - In hourly, what does in round brackets mean? What is meant by "pays time and half"?
3 - In base-plus-commissioned, is it required to take "base salary" from user or I just get salary from the salaried employee?
View 5 Replies
View Related
Feb 21, 2015
Create a payroll program to store and calculate the payroll for a small company with a maximum of 20 employees.
Program parameters are as follows:
1. Create a menu 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
Z or z to exit program
The information for each employee is: employee number, hours worked, pay rate per hour, tax deduction.
2. Use an array of doubles to store employee information.
3. Menu option A or a: ask the user for the employee information one value at . a time and store it in the array.
Please enter employee number: 2190
Please enter hours worked: 32.50
Please enter pay rate: 9.25
Please enter tax rate deduction: 5.50
4. Option D or d: ask the user for an employee number as integer and display . the information for the corresponding employee (cast the employee number
. in the array to integer and then compare). If employee number does not . match, output a msg. indicating "no such employee". If the employee number . is a match, 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
Tax deduction: 5.50 %
Total pay: $ 284.89
5. Option T or t: calculate and output the sum of the total pay of all
. employees.
6. Option S or s: display the information for all employees in the same
. format as in option B.
7. Option Z or z: exit the program.
#include <stdio.h>
#define MAX [20]
int main(void) {
int i;
for (i=0;i<=20;i++) {
char MenuOption=0;
int EmployeeNumber;
[Code] .....
View 1 Replies
View Related