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
How does voting help in a social news site?
Inessa05 [86]
It helps spread the word about certain candidates in an upcoming election.
6 0
3 years ago
Many organizations find themselves in the position of being data rich and information poor. Even in today's electronic world, ma
juin [17]

Answer:True

Explanation:

Many organizations find themselves in the position of being data rich and information poor. Even in today's electronic world, managers struggle with the challenge of turning their business data into business intelligence.Data in its raw form does not help managers in reaching their business decisions. In this electronic age data collection has been made simple .However the value of that data can only be seen when it is processed and it becomes information. It can help managers to make quick business decisions that will be used to make come up with important business strategies  .It follows that when data is collected in its various forms it should then be processed meaning that the business managers can either use business Intelligent software  that can present the data in a meaningful form like graphs . pie charts and other forms that can be easily interpreted and reflect the trends that have been presented by the raw data .The organisation should find value in the data that they have collected and tell the story that leaves in the data.

7 0
3 years ago
Choose 2 statements that correctly describe the time complexity of data structures with N data.
Softa [21]

The  statements that correctly describe the time complexity of data structures with N data are:

  • The average time complexity of the data lookup in a hash table is O(N).
  • The average time complexity of inserting data into a heap is O(logN)

<h3>What is time complexity of data structures?</h3>

Time Complexity of an algorithm is known to be the depiction of the amount of time needed by the algorithm to carry out to completion.

Note that The  statements that correctly describe the time complexity of data structures with N data are:

  • The average time complexity of the data lookup in a hash table is O(N).
  • The average time complexity of inserting data into a heap is O(logN)

Learn more about data from

brainly.com/question/17350816

#SPJ1

6 0
1 year ago
" _____ is a measure of the amount of information that can travel from a user to the Internet in a given amount of time."
Ainat [17]

Answer:

The answer is Upload bandwidth

Explanation:

Bandwidth refers to the highest transfer rate of data on an internet connection or network.

Upload bandwidth is the amount of data that moves from a computer to the internet or a network within a given amount of time. Documents, music files, video files, software and so on can be uploaded to the internet or a network.

6 0
3 years ago
Snap Me on <br>samxavier.18​
Ahat [919]

Answer:no thank you ima goody

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • RADIAC instruments that operate on the ionization principle are broken down into three main categories based on what?
    15·1 answer
  • Which finger types the highlighted keys on a number keypad? A. Third B. First C. Pinky D. Thumb
    7·2 answers
  • What task did the u.s. government undertake that many people identify as the birth of the internet
    5·2 answers
  • Which searching method requires that the list be sorted?
    5·1 answer
  • Frank is a writer. He needs to work for long hours and type for long periods on the computer. What injury can Frank develop?
    15·2 answers
  • ____ is the official web portal for the U.S. government, providing access to all official U.S. government services and informati
    12·1 answer
  • What is the correct order for writing the 3 dimensions for a 3D object? Here are the 3 dimensions:
    15·1 answer
  • Prior to the 1996 NEC, ____ receptacles and cords were permitted. However, now it is mandatory that a separate equipment groundi
    11·1 answer
  • Which item can be added to Outlook messages, like a Word document or PowerPoint presentation, that takes standard bulleted lists
    11·1 answer
  • If you try to add a new item to a full stack the resulting condition is called a(n)?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!