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
An embedded system describes computing technology that has been enclosed in protective shielding for security reasons. True or f
ddd [48]

The statement 'an embedded system describes computing technology that has been enclosed in protective shielding for security reasons is false.

In the field of computers and technology, an embedded system can be described as a small computer, more overly an integrated chip, that is enclosed in an electronic device in order for making the device to run. The small computer integrated into the device helps in regulating the device. The purpose of an embedded system is not for protective shielding or security reasons hence the statement above is false.

In an embedded system, a combination of computer processor, computer memory, and input/output peripheral devices is present that performs a dedicated function. Microcontrollers are used for the management of an embedded system.

To learn more about embedded system, click here:

brainly.com/question/13014225

#SPJ4

7 0
2 years ago
Which of the following parameters should match in order for a pair of routers to form an adjacency when running OSPFv2? (Points
Gnom [1K]

Answer: Subnet mask

Explanation:

 Subnet mask is the type of parameter that should be match in order to form the adjacency for running the OSPFv2. The subnet mask is mainly used to identifying the address of network in the system.

The OSPF enable the router that must form an adjacency with the neighbors before sharing any type of data.

It mainly determine the neighbors links in the OSPF. The OSPFv2 router send the special type of message which is known as hello packet in the network.  

 

4 0
3 years ago
Which resource helps a user access a cloud service?
gregori [183]

Answer B (Data storage system)

5 0
4 years ago
Change the following sentences using 'used to
Alinara [238K]

Answer:

a. We <u>used to</u> go to school together.

b. How did you <u>use to</u> spend the winter evenings?

c. We <u>used to </u>have our milk delivered.

d. I <u>used to</u> be in love with him.

e. At one time there <u>used to</u> be trees in the garden.

5 0
3 years ago
GoInternet, Inc., is an Internet-access service provider that is being forced to manage numerous unwanted e-mail messages from a
marissa [1.9K]

Answer:

The correct answer to the following question is option b.)sends messages involving products of companies previously sued under the CAN-SPAM Act.

Explanation:

This act is an act of Controlling the Assault of Non-Solicited Marketing And Other things.

It is the law that establish the rules for the commercial message and the commercial e-mails, gives recipients right to have the business stops emailing them, and they outline the penalties incurred for those person who has violated the law.

8 0
3 years ago
Other questions:
  • The gaining of unauthorized access to data in a<br> system or computer:
    11·1 answer
  • 12. Good digital citizenship includes keeping in mind who has access to the internet and who does not. (1 point)
    15·2 answers
  • A user saves a password on a website the user logs into from a desktop. Under which circumstances will the password be saved on
    14·1 answer
  • If you delete an imessage does the other person see it
    12·1 answer
  • Identify the computer cycle in each of the descriptions below by choosing the answer from the
    12·1 answer
  • What is the best way to locate where my C program gets into an infinite loop
    5·1 answer
  • Given an array of integers and the size of the array, write a function findDuplicate which prints the duplicate element from the
    11·1 answer
  • To change the name of a field, press and hold or right-click the column heading for the field, tap or click ____ on the shortcut
    7·1 answer
  • What direction would a sprite go if you constantly increased its x property? Your answer What direction would a sprite go if you
    7·1 answer
  • My brainly isnt working it isnt showing and answers wats going on? wat do i do
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!