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

  Questionthink about a cellular system with a total

questionthink about a cellular system with a total bandwidth of 30 mhz. each full duplex voice or control channel uses

  Why we use void main in c programming

Why we use void main in C programming?

  Analyze randomize quick-sort is to use a recurrence equation

Analyze randomized quick-sort is to use a recurrence equation. In this case, we let T(n) denote the expected running time of randomized quick-sort.

  Create an interface for automobile mechanics

Imagine you are managing a design project that will create an interface for automobile mechanics. The interface would be used by the mechanics to look up.

  Identify criteria that you would use to choose platforms

how you would choose between purchasing a desktop, laptop, notebook or mobile device. Identify criteria that you would use to choose one of these platforms

  Subtraction using 1s compliment and 2s compliment

Perform the given subtraction using 1's compliment and 2's compliment.

  Advantages for using the object oriented approach

Supporters of object oriented databases list numerous advantages for using the object oriented approach versus the relational one. Is the relational database model doomed to extinction or are there characteristics of the relational model that make..

  Questionsstudy any two multicore processor architecture and

questionsstudy any two multicore processor architecture and discuss the following features briefly.a bus architectureb

  You made a sorting algorithm its running time turned out to

you created a sorting algorithm. its running time turned out to be on2. how much better can you make this algorithm ?

  Predict the future role of the communication technology you

select one 1 of the following topics in which you will base your responses in the form of a term papernetwork

  Give an example of a nonporous item and what method you

1.give an example of a nonporous item and what method you would use to process it. where might you expect to find

  Identify three key learning points that are associated

Learning Reflections on Observational Methods- Identify 2-3 key learning points that are associated with using observation as a data-gathering process.

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