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
A nonpipelined system takes 300ns to process a task. The same task can be processed in a 5-segment pipeline with a clock cycle o
Vladimir79 [104]

Answer:

Pipelined architecture is 1.667 times more speedy than non pipelined architecture.

Explanation:

There are five stages to to complete an instruction to execute in pipeline architecture. as

Stage 1:  Instruction Fetch

Stage 2: Instruction Decode

Stage 3: Execute

Stage 4: Memory Access

Stage 5 : Write Back

The pipeline architecture processed instruction as given below. Each Stage take 1 clock cycle, which is represented as CC.

                Stage 1           Stage 2         Stage 3         Stage 4            Stage 5

I1:              1cc                  2cc                 3cc                4cc                   5cc

I2              2cc                 3cc                  4cc               5cc                   6cc

I3              3cc                  4cc                 5cc              6cc                    7cc

I4              4cc                 5cc                  6cc              7cc                    8cc

each four Instructions set takes 8 Clock Cycles.

I5              9cc                  10cc                11cc               12cc                 13cc

I6              10cc                 11cc                  12cc             13cc                 14cc

I7              11cc                  12cc                 13cc              14cc                 15cc

I8              12cc                 13cc                  14cc              15cc                16cc

.

.

.

I97:             193cc            194cc              195cc              196cc               197cc

I98             194cc             195cc             196cc               197cc               198cc

I99            195cc             196cc              197cc              198cc               199cc

I100         196cc                197cc             198cc            199cc                 200cc

<u>Pipelined architecture Time Calculation</u>

So in pipeline architecture 100 instructions takes 200 clock cycles to execute.

1 Clock Cycle time period is = 60ns.

200 Clock Cycle =  60ns * 200 = 12000 ns

<u>Non Pipelined architecture Time Calculation</u>

1 task Time period= 300ns

100 task time period = 100 * 300 =  30000 ns

The difference between pipelined and non pipelined architecture time period is = 30000 - 12000 = 18000 ns

<u>Speedup ratio</u>

<em>Speed up ratio= 30000/18000 =  1.667</em>

7 0
3 years ago
List any feature of drwing toolbal​
ElenaW [278]

Answer:

The tools in this part of the Drawing toolbar are:

Select: selects objects. To select multiple objects click on the top leftmost object and while keeping the mouse button pressed, drag the mouse to the bottom rightmost object of the intended selection. A marching ants rectangle identifying the selection area is displayed. It is also possible to select several objects by pressing the Control button while selecting the individual objects.

Line: draws a straight line.

Arrow: draws a straight line ending with an arrowhead. The arrowhead will be placed where you release the mouse button.

Rectangle: draws a rectangle. Press the Shift button to draw a square.

Ellipse: draws an ellipse. Press the Shift button to draw a circle.

Text: creates a text box with text aligned horizontally.

Vertical text: creates a text box with text aligned vertically. This tool is available only when Asian language support has been enabled in Tools > Options > Language Settings > Languages.

Curve: draws a curve. Click the black triangle for more options, shown below. Note that the title of the submenu when undocked is Lines.

4 0
3 years ago
The steps for moving data from one cell to another are _____.
VMariaS [17]

The answer is C because you wouldn’t place it in the middle

8 0
3 years ago
Which option is an example of a Boolean operator?<br> O A. HTML<br> O B. <br> C. SEO<br> D. NOT
gayaneshka [121]

Answer:

D

Explanation:

Boolean Operators are simple words (AND, OR, NOT or AND NOT) used as conjunctions to combine or exclude keywords in a search, resulting in more focused and productive results. ... Proximity Operators (with, near and others) can also help you in searching. See Using Proximity Operators for more details and examples.

8 0
3 years ago
Which of the following statements is true of a server? Question 18 options: A) It supports processing requests from remote compu
TiliK225 [7]

Answer:

Option (A) is the correct answer of this question.

Explanation:

The server supports the processing requests from the remote computers. A system is a device built to accommodate inquiries from many other external systems and customers to execute transactions. Employees are called private computer ,tablets, including phones which connect websites.

Network resources are handled through servers.The server is a software application or tool providing a service to some other software program and its customer, also identified as those of the user.

Other options are incorrect because they are not related to the given scenario.

5 0
3 years ago
Other questions:
  • The ____ contains methods that allow you to set physical properties such as height and width, as well as methods that allow you
    14·1 answer
  • Select all of the uses of presentation software in the workplace.
    8·1 answer
  • Write an examples of Output device, storage devices and inputs device 10 each excluding the common ones​
    5·1 answer
  • Any parameter that receives a value and also sends a value outside the function must be declared as a reference parameter.
    8·1 answer
  • Cuales Son las características de la máquina analítica de Carlos Babbage ?
    11·1 answer
  • Which of the following is not true about search engine advertising?
    15·1 answer
  • Manuel is working on a project in Visual Studio. He wants to keep this program showing on the entire desktop, but he also needs
    13·1 answer
  • What is the second stage of information processing cycle​
    10·2 answers
  • If you want the input gear to spin in the same direction as the output gear you must use a _______ gear.
    13·1 answer
  • Which user interface part shows graphical output of mined data?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!