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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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