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

  You will create a linked list module

You will create a linked list module that exactly meets the specifications given in the supplied header (.h) file. The playlist program must accept a filename on the command line (argv).

  Implementation of classes

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

  Write a program in c that will find smallest value

Write a programe 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.

  Create if-then statement with single alternative decision

Create the If-Then statement (or a flowchart with a single alternative decision structure) which assigns 20 to  variable y and allots 40 to variable z if variable x is greater that 100.

  Reads in a list of integers

Write a program in C++ that reads in a list of integers into and array with base type int. Provide the facility to either read this array from the keyboard or from a file, at the user's option. If the user chooses file input, the program should reque..

  Write function to find whether number is perfect number

Write down the function perfect which determines whether number is perfect number or not. This function must receive number and return true if number is perfect.

  Convert celsius temperatures to fahrenheit temperatures

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

  rewrite that statement in a more readable style.

Give an example statement in C, C++, or Java that is particularly unreadable. Rewrite that statement in a more readable style.

  A constructor and a destructor

A constructor and a destructor, Insert a new element chosen by the user at the correct place in the list

  Design in c a unix utility program gasp

Design in C a Unix utility program gasp. Command gasp [options] STRING FILE... must read listed files (FILE...) and copy each line from input to stdout if it contains STRING.

  Distinguish syntax and purpose of while-loop and for-loop

Distinguish the syntax and purpose of while-loop and syntax of a for-loop. Give C++ code examples of both loops and descriibe the main differences.

  Array of integers declared-initialized to number of tickets

Array of integers named parkingTickets has been declared and initialized to number of parking tickets given out by city police each day as beginning of current year.

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