Use a loop in main to efficiently handle all three persons

Assignment Help C/C++ Programming
Reference no: EM13315594

Stinclude <iostream>

It include <fstream> // use this if you want to read the data from a file; otherwise you can omit it using namespace std;

class Employee

private:

int id, nodependents;

char status; // 'W' salaried worker, 'A' apprentice

double hours[5]; // array to hold hours worked in a normal week

double standardrate; double SumUpHours();

double CalculatePaycheck(); // total hours times standard rate (except apprentices earn

/1 only 78.5% of the standardrate), minus deductions

double CalcDeductions(double gross); /1 Deductions are 22.0% of total pay for Federal Tax withholding, and // $75.25 for each dependent for health insurance

public:

Employee(); // the constructor. Initialize the standardrate to be 41.75

void SetPersonalData(); // stores the id number, no. of dependents, and status void InputHours(); // store the five weekday hours

double GetTotalHours();

double GetPaycheck();
};

int main()

Employee person[3];

int p;

cout.setf(ios::fixed);

cout.setf(ios::showpoint); cout.precision(2);

Plan and finish writing the main program, and all the functions, including a constructor. Use a loop in main to efficiently handle all three persons' data. Make use of all the private and public member variables and functions set up in the class definition of Employee. Read in input only from inside the functions SetPersonalData and InputHours, and write out the results only from the main program. The results should look like what's shown below.Test your program using, for example, the data

553 2 W
8.0 4.0 8.0 4.0 6.0

491
10.0
297
5.0 0 W
12.0 8.0 10.0
1 A
4.0 6.0 6.0 9.0

2261_database.png


or any similar data. The hours don't have to be whole numbers. they could be 5.5 14.2 9.8 6.5

Reference no: EM13315594

Questions Cloud

How you would present some of the best practices in security : Detail how you would present some of the best practices in security, including concerns surrounding operating systems, databases, authentication and password policies, user administration, etc. Be sure to consider the audience of this presentation..
The molecular weight of vincristine a pharmaceutical drug : The molecular weight of vincristine, a pharmaceutical drug
Judicial review is concerned with decision making process : Judicial Review is concerned with the decision making process because it examines or focuses on how the decision was made, and therefore determines the legality of how the decision was reached or concluded. However, judicial review does review whethe..
Describe what happens to the direction of the vector : if you switch the sign of all the components of a vector (this called"parity reversal "),what happens to the length of the vector. what happens to the direction of the vector
Use a loop in main to efficiently handle all three persons : Plan and finish writing the main program, and all the functions, including a constructor. Use a loop in main to efficiently handle all three persons' data.
Compute poissons ratio for material at modulus of elasticity : A cylindrical specimen of some alloy 50.26 mm2 in cross sectional area is stressed elastically in tension. A force of 1620 N produces a reduction in specimen diameter of 5 X 10-3 mm. Compute Poisson's ratio for this material if its modulus of elas..
Determine what must be the allowable elongation : A cylindrical rod of brass alloy (E = 100 GPa,) having a yield strength of 345 MPa is to be subjected to a load of 7500 N. If the length and diameter of the rod are 338 mm and 7.55 mm respectively, what must be the allowable elongation
What the concentration in the effluent be 7 days later : A lagoon with volume 1,200 m3 has been receiving a steady flow of a conservative waste at a rate of 100 m3/day for a long enough time to assume that steady-state conditions apply. The waste entering the lagoon has a concentration of 10 mg/L.
Determine the percentage increase in the discharge the ditch : As part of a drainage improvement project, a drainage ditch will be straightened and cleaned. As a result, the lenght of the ditch will decrease from 1800 ft to 1400 ft and the mannings roughness factor will be reduced to 0.018 from 0.022.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  After the array is created and loaded

After the array is created and loaded, the problem is then to sort the array and print out the contents of the sorted array. Please use a separate function for the sort routine and also a separate function for the print out of the array.

  Write a program that will convert us dollar amounts

Write a program that will convert US dollar amounts to Canadian dollar (1 CND = 0.92 USD). Format your currency amounts in two decimal places and trailing zeros.

  File system with login authentication

Implement a simple file system with login authentication and access control - Construct a hash/salt/shadow based user/password creation system.

  Calculate the plane coefficients

Calculate the plane coefficients (A,B,C and D)  of 3 points in a plane defined by P1, P2 and P3, and determine if the point P4 is behind or in front of the polygon surface contained within that plane.

  Principle ofsuperposition to determine that system is linear

Apply the principle of superposition to determine whether the following systems are linear. Sketch what the plot of the function looks like.

  Write and test c program which outputs waveform

Write and test a C program which outputs waveform which switches from 10.0 kHz with a 50% duty cycle to 25.0 kHz with a 5% duty cycle every 5 seconds.

  Function odd_fill() that fills all integers between two poin

write a function odd_fill() that fills all integers between two pointers, first and last, with a sequence of odd integers: 1,3,5,7

  Write a program to calculate cars mileage

If you are using VisualStudio 2005, you should include time.h. The call to srand should use the time rather than a number entered by the user and looks like this: srand( static_cast(time( NULL )) ).

  Write a program that computes the cost of long distance call

Write a program that computes the cost of a long distance call. The cost of the call is determined according to the following rate schedules.

  Functions to compute stress and strain in steel rod

Write a main function and the following functions to compute the stress and strain in a steel rod of diameter D (inches) and length L (inches) subject to the compression loads P of 10,000 to 1,000,000 pounds.

  Calculates an employees wage for a week

Write a program that calculates an employee's wage for a week. An employee's wage is calculated as follows - if the number of hours is less than or equal to 40, then the total payment is hour rate

  Write c program to find smallest-largest values

Write a program c that will find the smallest, largest and average values in a collection of N numbers.Get the value of N before scanning each value in the collection of N numbers.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd