C++ How to Program (10th Edition)
C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 3, Problem 3.11E

(Employee Class) Create a class called Employee that includes three pieces of information as data members—a first name (type string), a last name (type string) and a monthly salary (type int). Your class should have a constructor that initializes the three data members. Provide a set and a get function for each data member. If the monthly salary is not positive, set it to 0. Write a test program that demonstrates class Employee's capabilities. Create two Employee objects and display each object's yearly salary. Then give each Employee a 10 percent raise and display each Employee's early salary again.

Blurred answer
07:35
Students have asked these similar questions
Please fill in the blanks for the following statements: To define a class use the keyword ________________ followed by the name of the class.
Can you please help me with these questions? 1) When the left operand of a function that overloads an operator is NOT an object of the class, or a reference to such an object, the function must be declared as a ___ because it is a ___ function. friend, non-member member, void member, overloaded friend, member   2) To overload the greater than operator, you define an operator method whose name is ___.   > operator> >operator greaterThan   3) A(n) ___ ADT is used to store a homogeneous, one-dimensional, sequential, set of data items with a specific ordering. The ordering can be changed, as needed.     list     stack     queue      tree
Does a friend function violate the data hiding? Explain briefly. Write a program to swap variables of two classes using friend function. C++

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
What is Abstract Data Types(ADT) in Data Structures ? | with Example; Author: Simple Snippets;https://www.youtube.com/watch?v=n0e27Cpc88E;License: Standard YouTube License, CC-BY