Demonstrate the class by writing a program that creates

Assignment Help Computer Engineering
Reference no: EM132164392

Using C++,

Design a class called EmployeeInfo that has the following member variables:

name

hourly rate

number of hours worked

The class has only a default constructor that assigns empty strings ("") to the name and 0 to the hourly rate and number of hours worked.

Write appropriate mutator functions that store values in these member variables and accessor functions that return the values in these member variables: getName, getHourlyRate, getHoursWorked, setName, setName, setHoursWorked, and calculatePay. You calculate the weekly pay by multiplying the hourly rate by the number of hours worked (to make it simple, there's no overtime rate).

Demonstrate the class by writing a program that creates one instance of it. Ask the user to enter the employee name, hourly rate and hours worked.

Store them in the object. Display the data and the weekly pay. Exit the program when the user senter "stop."

Input Validation: Do not accept negative alues for the hourly rate and hours worked.

Sample Run Welcome to my payroll program Enter the employee name (stop to exit): John Doe Please enter hourly rate: -2 Invalid hourly rate. Please enter positive numbers only:-1 Invalid hourly rate.

Please enter positive numbers only:20 Please enter the number of hours worked: -5 Invalid amount of hours worked. Please enter positive numbers only:-6 Invalid amount of hours worked.

Please enter positive numbers only:40 Employee Name: John Doe Weekly pay amount : 800.00 Enter the employee name (stop to exit): Henry Smith Please enter hourly rate: 10 Please enter the number of hours worked: 20 Employee Name: Henry Smith Weekly pay amount : 200.00 Enter the employee name (stop to exit): stop

Reference no: EM132164392

Questions Cloud

Population variances are unequal : Assuming that the population variances are unequal, you need to test the claim that infertile females have lower AMH levels than fertile females using a 0.05
Explain the unique supervisory challenges : Explain the unique supervisory challenges that will exist in a prison. What types of employee misbehavior are possible, and how can management guard against.
Create an iterator that will allow the program to return : Create unique key values (Do not use map class from STD library.) Create an iterator that will allow the program to return the key,value pairs.
Normal approximation to the distribution : How large must n be in order that the normal approximation to the distribution of x be valid?
Demonstrate the class by writing a program that creates : Demonstrate the class by writing a program that creates one instance of it. Ask the user to enter the employee name, hourly rate and hours worked.
Find the probability that it will be approved : If one percent of the larger group is defective, find the probability that it will be approved for shipment
Which type of budgeting system is most appropriate : On what basis shall we allocate resources to Program A instead of Program B," is the perennial statement in public sector budgeting.
What is the probability he will win : In order to win the game, he must roll a "6" on the first roll and at least one of the other rolls. What is the probability he will win?
Create a function to sort alphabetically by student name : Using C I need to make a copy of an original array of students and create a function to sort alphabetically by student name.

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