Calculate and print pay slips

Assignment Help Computer Engineering
Reference no: EM132210424

Question :

Write a program named question6a.cpp that will calculate and print pay slips. User inputs are the name of the employee, the number of hours worked and the hourly pay rate. You have to declare three functions.

a) one for input;

b) one to calculate the employee's pay; and

c) one to print the payslip.

The input function has to input the name of the employee, the number of hours worked and the hourly pay rate into the variables theEmployee, theHoursWorked and thePayRate.

The variable employee is a string and the other two variables are of type float. As the values of theEmployee, theHoursWorked and thePayRate will be changed in this function, reference parameters need to be used. The calculation function will receive two parameters that represent the number of hours worked and the hourly pay rate, do the calculation and return the pay for the employee.

An employee, who has worked more than 40 hours, is paid 1.5 times the hourly pay rate for each hour of overtime. As the parameters are not changed in the function, they should be value parameters. The function should return a float value which represents the pay.

The output function has to display the name of the employee, the number of hours worked, the number of overtime hours and the hourly pay rate entered by the user as well as the employee's pay. For example:

Pay slip for Harry Matsipe

Hours worked: 43.5 hours

Overtime hours: 3.5

Hourly pay rate: R125.35

Pay: R5672.09

The main function includes a for loop that allows the user to repeat the calculation of a pay slip for five employees. We give the main function below. You must submit the three functions you have developed as well as output for repeating the loop five times with the following input data:

Harry Matsipe 43.5 125.35

Ellen Malan 39.4 112.75

Joey Rashdien 40 120.45

Mpho Bopape 41.2 123.60

Veli Singh 39.7 135.30

Reference no: EM132210424

Questions Cloud

Write a program to model a simple calculator : Write a program to model a simple calculator. Each data line should consist of the next operation to be preformed from the list below and the right operand.
Is the monument representational or nonrepresentational : Imagine that there is a competition to design a public monument in New Orleans. It must commemorate a historical local event, such as, an aspect of Hurricane.
Write a program to operate a light : Write a program to operate a light according to the following sequence: A momentary pushbutton is pressed to start the sequence.
An arbitrary number of hexadecimal numbers can be entered : An arbitrary number of hexadecimal numbers can be entered from the keyboard and stored in a array.
Calculate and print pay slips : Calculate and print pay slips. User inputs are the name of the employee, the number of hours worked and the hourly pay rate.
Discuss the threat modeling techniques : Write a 3 to 5 page paper with proper APA formatting using the threat modeling techniques we have gone over thus far to uncover any threats that jump out.
Examine the continuity : Use definition to prove that the given limit statement is correct - Find the limit - Examine the continuity
List each philosophy and its definition : The ancient Greek philosophies of Humanism, Rationalism, Naturalism, and Idealism directed Greek culture and influenced their art.
Analyze the flow of patients through the emergency room : Write a program that helps a hospital analyze the flow of patients through the emergency room.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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