Structs in an array of employee data.

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

Below is the instructions of my C++ Lab. The program must build in Microsoft Visual C++. Please use headers so the program will compile 

A sample data file is provided for your testing purposes as follows:

4

101     41        8.11    Y         49

722     32        7.22    N         40

1273   23        5.43    Y         39

2584   14        6.74    N         45

The first integer in the file corresponds to the number of data rows in the file, the data rows represent employee information for a small company and is interpreted as follows:

Employee No.

Department

Pay Rate

Exempt

Hours Worked

101

41

8.11

Y

49

722

32

7.22

N

40

1273

23

5.43

Y

39

2584

14

6.74

N

45

Write a C++ program to read the employee file as structs in an array of employee data.

Prompt for the name of the input file.

i.e.

struct empData

{

   int empNo,

        departNum,

   double payRate,

               hrsWrkd;

   char     exempt;

};

 

Read the first integer in the file, then create a dynamic array of the correct size to hold the employee information.

Create a payroll output file with headers similar to that shown in the following list. Prompt for the name of the output file. The output file is to contain the following data:

a. Employee number (left justified)

b. Department

c. Pay Rate

d. Exempt

e. Hours Worked

f. Base pay (pay rate * hours worked)

g. Overtime pay

h. Total pay

    Overtime pay is calculated only for nonexempt employees. An employee is exempt if 'Y' appears in the exempt column. Overtime is paid at time-and-a-half for all hours worked over 40. If an exempt employee works over 40 hours or under 40 hours, that employee is only paid for 40 hours of work.

For the sample data file the resultant output file would have the following content:

Emp. No. Department          Rate    Exempt           Hours Base             Overtime        Total

101                 41                    8.11    Y                     49        $324.40          $0.00            $324.40

722                 32                    7.22    N                     40        $288.80          $0.00            $288.80

1273               23                    5.43    Y                     39        $217.20          $0.00            $217.20

2584               14                    6.74    N                     45        $269.60          $33.70            $303.30

Your program should be modular and use functions for the bulk of the code in your main function.

Also don't forget to use internal comments.

 

 

Reference no: EM13161319

Questions Cloud

State component in the original mixture : How do I find the weight percent of each component in the original mixture and would this affect the outcome if Methanol had been used in place of the dichloromethane? Product weight of Oil: 0.11g & Product weight of Polypropylene Glycol : 0.19g.
Define a function to calculate the values : Be sure to define a function to calculate the values and print the table displaying the interest rate in the first column, the monthly payment in the second column, and the total payment in the third column. Your program should not allow the user to ..
Colonial violence in the last quarter of the 17th century : Colonial violence in the last quarter of the 17th century most clearly led to:  the Glorious Revolution.  tighter control over the colonies by the mother country.
Huge integer class : Huge Integer Class) Create a class HugeInteger which uses a 40-element array of digits to store integers as large as 40 digits each. Provide methods parse, toString, add and subtract. Method parse should receive a String, extract each digit using met..
Structs in an array of employee data. : Below is the instructions of my C++ Lab. The program must build in Microsoft Visual C++. Please use headers so the program will compile
Explain blue complex formed between starches and iodine : The blue color of dextran blue solution is due to the well-known, blue complex formed between starches and iodine. If you only had the absorption spectrum of this solution
Compute a program that calculates three resistance inputs : C language, compute a program that calculates three RESISTANCE inputs, and gives you the total resistance in OHMS. Like this, the total resistance is _____ ohms. These are three parallel circuits so the formula would be (1/R1 + 1/ R 2 +  1/ R 3 )  -1
Java code using jframe : Write a Java code using JFrame. This code needs to manipulate 4 shapes(2 rectangles and 2 squares) in a 400x400 JFrame. This needs to manipulate the shapes in 3 different ways, using 3 different methods. One for translating a shape, one for proportio..
The initialization program : The initialization program will start with how much you have in the cash register and in what denominations the money is in.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Implement circular linked list in c program

implement circular linked list in c program in the best possible easiest way.

  Create a template class

Create a template class, SVector, that implements a constructor

  Three or more dimensions

What kind of program, or problem, might necessitate arrays of three or more dimensions?

  What constructors do and when they are executed

Explain what constructors do and when they are executed. Explain the two types of constructors. Provide an example class that includes both types of constructor functions and demonstrate how an object would be instantiated using both types of constru..

  Write a matrix multiplication program

Write a C++, matrix multiplication program which you can instrument to monitor and measure execution time as a function of problem size. Make sure it works in Microsoft Visual Studio.

  Returns a count of the steps through the sort

Please write a c++ implimentation that returns a count of the steps through the sort. (do not worry about updating count, I will rewrite that segemnt. I need help with writing the shell sort.

  C program to compute parking fare for customers

Write C program to compute parking fare for customers who park their cars in parking lot when following information is provided: A character showing type of vehicle: C for car, B for bus and T for truck

  Create class having constructor to recieve two ints

Create a class (in C++)named Card. The class should have two int data members named face and suit.The class should have a constructor that recieves the two ints and uses them to initialize the data members.

  Code to implement a staque

Write a C++ code to implement a Staque. Since the data structure is all about inserting and deleting numbers, it would be a good option to use a linked list to implement Staque.

  Determine the meaof the numbers in the array

Determine the mean(average) of the numbers in the array, and output the reslt. Use a subprogram to input the numbers, a function to find the mean.

  Programmingto compute the volume of water in the cubic feet

Write down an algorithm (Programming in C) in order to compute the volume of water in the cubic feet, flowing through a pipe of diameter d in feet, having a velocity of v feet per second.

  Project

Unit 3 Individual Project SSCI210 – 1304B – 01 A typical individual who commits who commits hate crimes whether it is against or aimed at the Gay/lesbian community , the persons of color or the Jewish community, ( I mention these three because they a..

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