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

  What other error-detection techniques are available

What other error-detection techniques are available? How do they compare to parity and cyclic redundancy checksum?

  Describe the usability properties of interactive systems

Building a user interface that meets the needs of a diverse population can be incredibly difficult. Research the best practices for developing a universally.

  What makes a special occasion

What makes a special occasion? How can you apply, to special occasion speeches, the speaking skills you have worked on throughout the term?

  Identify tools used to develop object oriented data model

Identify tools used to develop object oriented data model. Define its differences between object oriented data modeling and relational data modeling.

  Define how storage systems used in information systems

You will begin with your own Internet and/or Walden Library search for 1 or 2 current and credible articles on the various types of data resources, processes.

  Develop a simple checkout system that system was so

develop a simple checkout system. that system was so successful that theyve decided to expand their operations by

  Determine who has jurisdiction over the internet

After reading about the origin of the internet in the textbook, how difficult it is to determine who has jurisdiction over the internet and global implications.

  Explain the role of cyber-security privacy controls

Create an overview of the HIPAA Security Rule and Privacy Rule. Explain the role of cyber-security privacy controls in the review of system processes.

  Input various sentences as c-strings and perform conversions

Reverse the order of the words, and print all letters in upper case; there will be no punctuation in this version.

  Preare program to implement the basic ray-tracing algorithm

Write a program to implement the basic ray-tracing algorithm for a scene containing any specified arrangement of spheres and polygon surfaces illuminated.

  Determine how much money you earned or lost with each stock

Summarize the various accounting systems that each firm provides. Be sure to address the following for each firm: a. The various types of accounting systems it sells (e.g., Oracle sells Oracle Financials as well as PeopleSoft financials)

  If 32 equally spaced steps are used instead of 16 what

consider an analog signal which can range from -4v to 4v. the input signal is sampled at 20000 samples per second. the

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