1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Yuri [45]
3 years ago
12

Write the class definition for a class named Employee. The class should include data members for an employee object%u2019s name

and salary. (The salary will be an integer). The class should contain two member functions: the constructor and a function that allows a program to assign values to the data members.
Step 2:

Add two member functions to the Employee class. One member function should allow any program using an employee object to view the contents of the salary data member. The other member function should allow the program to view the contents of the employee name data member. (Hint: Have the member function simply return the contents of the appropriate data member.)

Sep 3:

Add another member function to the Employee class. The member function should calculate an employee object%u2019s new salary, based on a raise percentage provided by the program using the object. Before calculating the raise, the member function should verify that the raise percentage is greater than or equal to zero. If the raise percentage is less than zero, the member function should display an error message.

Step 4:

The instructions to create an employee object, assign values to the object, display the name and current salary, calculate the new salary, and then display the new salary are missing from the program. Complete the program, using these comments as a guide.
Computers and Technology
1 answer:
kykrilka [37]3 years ago
7 0

Answer:

see explaination

Explanation:

#include <iostream>

#include <string>

using namespace std;

class Employee

{

string name;

int salary;

public: Employee()

{

}

Employee(string name, int salary)

{

this->name=name;

this->salary=salary;

}

void setName(string name)

{

this->name=name;

}

void setSalary(int sal)

{

this->salary=sal;

}

string getName()

{

return name;

}

int getSalary()

{

return salary;

}

void raiseSalary(int percentage)

{

if(percentage<0)

{

cout<<"Invalid percentage";

}

else

{

salary=salary+((float)percentage/100)*salary;

}

}

};

int main()

{

int percentage;

Employee e1("Satur",1000);

cout<<"Employee details are:";

cout<<e1.getName();

cout<<e1.getSalary();

cout<<"Enter the percentage raise";

cin>>percentage;

e1.raiseSalary(percentage);

cout<<"Raise in salary:";

cout<<e1.getSalary();

return 0;

}

You might be interested in
Hazel has just finished adding pictures to her holiday newsletter. She decides to crop an image. What is cropping an image?
Ilya [14]
B) cutting off part of the image

hope it helps
3 0
3 years ago
How are envelopes and letterheads different
choli [55]
Envelope - a flat paper container with a sealable flap, used to hold a small letter or document.

letterhead - a printed heading on stationery stating a person's or organization's name and address. A letterhead is very important when it comes to businesses.

Hope this helps! =D
8 0
4 years ago
The laser in a compact disc (cd) player uses light with a wavelength of 715 nm. what is the frequency of this light?
oee [108]
In order to get the frequency of this light you have to d<span>ivide the speed of light by the wavelength. 
The formula: </span>F = c / w<span>
Set the values in the appropriate form:</span>740nm = 7.40e-9m


Solution: 
3.00e8m/s : 7.40e-9m &#10;&#10;&#10;F = 6.38e16Hz
The answer:  = 63.8PHz
6 0
3 years ago
why is there a need of properly interpreting teacher's/manufacturer's specifications before operating any food processing equipm
mash [69]

Answer:

Explanation:

This is a significant need because the teacher's/manufacturer's specifications are created so that the individual operating the equipment knows how to properly operate it. Failure to read and properly interpret these specifications can lead to the damaging of the equipment, damaging the food, contamination of the food, and even injury/death to the operator. That is why it is crucial that the information is read and interpreted correctly as well as implemented as instructed.

7 0
3 years ago
“If the information ______________________, then that information (should / should not) be stored because _____________. For exa
lisov135 [29]

The blanks spaces are filled with the following;

  1. Is confidential, should not
  2. There's risk of information theft on the cloud
  3. Social security number, should not

<h3>Confidential information and the storage cloud</h3>

According to McGinley, in some cases, storing any type of personal information for one's self or one's customers in the cloud would be a mistake. Information relating to date of birth, Social Security number, passport numbers should not be kept in the cloud.

This follows from the fact that "Cloud providers are no less bulletproof than any of the other previous industry."

Read more on information storage;

brainly.com/question/24688176

5 0
3 years ago
Other questions:
  • A good place to get hints about how to answer a response question could be a. Your teacher c. Both of these b. The rest of the t
    13·2 answers
  • The audience for your security assessment report (SAR) is the leadership of your company, which is made up of technical and nont
    6·1 answer
  • When a CPU executes instructions as it converts input into output, it does so with
    12·1 answer
  • A ________ is a powerful analytical tool to size up Apple Inc.'s competitive assets in order to determine whether or not those a
    9·1 answer
  • Importancia de la química en la vida cotidiana​
    15·1 answer
  • Which element can be changed using the Print pane? Check all that apply
    9·1 answer
  • (python) Given the formula for conversion from Celsius to Fahrenheit
    10·1 answer
  • Which of the following is NOT a font style?<br> Italic<br> Bold<br> Regular<br> Iconic
    10·2 answers
  • In binary, if there is a 1 in the 1s place the number is always
    9·1 answer
  • The television is the biggest technological advancement in communication since the telephone.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!