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
algol [13]
3 years ago
6

In this lab, you complete a prewritten C++ program that calculates an employee’s productivity bonus and prints the employee’s na

me and bonus. Bonuses are calculated based on an employee’s productivity score as shown below. A productivity score is calculated by first dividing an employee’s transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked.
Productivity Score Bonus
= 200 $200
Instructions
Ensure the file named EmployeeBonus.cpp is open in the code editor.

Variables have been declared for you, and the input statements and output statements have been written. Read them over carefully before you proceed to the next step.

Design the logic, and write the rest of the program using a nested if statement.

Execute the program by clicking the Run button and enter the following as input:

Employee’s first name: Kim
Employee's last name: Smith
Number of shifts: 25
Number of transactions: 75
Transaction dollar value: 40000.00
Your output should be:
Employee Name: Kim Smith
Employee Bonus: $50.0
Grading
When you have completed your program, click the Submit button to record your score.
Computers and Technology
1 answer:
Bas_tet [7]3 years ago
6 0

Answer:

The answer to this question is given below in the explanation section

Explanation:

    The formula for productivity socre is      

 productivity score = ((transaction dollar value/no of transaction)/no of shift)

Productivity Score Bonus  is:  

<=30 $50

31–69 $75

70–199 $100

>= 200 $200

........................................................................................................................................

the code is given below

........................................................................................................................................

#include <iostream>

using namespace std;

int main()

{

   string firstName;

   string lastName;

   int noOfShift;

   int noOfTransaction;

   int transactionDollarValue;

   int productivityScore;

   int bonus;

   

   cout<<"Employee’s first name: ";

   cin>>firstName;

   cout<<"Employee's last name: ";

   cin>>lastName;

   cout<<"Number of shifts:";

   cin>>noOfShift;

   cout<<" Number of transactions: ";

   cin>>noOfTransaction;

   cout<<"Transaction dollar value:";

   cin>>transactionDollarValue;

   productivityScore = (transactionDollarValue/noOfTransaction)/noOfShift;

   

   if (productivityScore <= 30)

   {

       bonus =50;

       cout<<"Employee’s first name: "<<firstName<<" "<<lastName;

       cout<<endl;

       cout<<"Employee Bonuse: $"<<bonus;

       cout<<endl;

   }

   

   else if (productivityScore >= 79 && productivityScore <=199)

   

   {

       bonus =100;

       cout<<"Employee’s first name: "<<firstName<<" "<<lastName;

       cout<<"Employee Bonuse: $"<<bonus;

   }

   

   else if (productivityScore >= 200)

   

   {

       bonus =200;

       cout<<"Employee’s first name: "<<firstName<<" "<<lastName;

       cout<<"Employee Bonuse: $"<<bonus;

   }

   

   return 0;

}

               

       

You might be interested in
What kind of voltage do solar cells generate? Solar cells produce ______ voltage which is not usable by most household appliance
beks73 [17]

Answer:

open circuit voltage

Explanation:

7 0
3 years ago
((Sorry for the self promo btw) Can you guys help me try and get affiliate on twitch? I am currently at 20 followers and it woul
Setler [38]
I’d love to check your twitch out! can I ask what ur time zone is? (just wanna know if it’s late or early for my time zone <3 )
8 0
3 years ago
Read 2 more answers
The the concept of plug-and-play is demonstrated by which of the following scenarios
Vitek1552 [10]

Answer:

What are the Scenarios

I will update this when you give us them

Explanation:

5 0
3 years ago
Read 2 more answers
Programmers use a(n) ____ when they need the computer to repeatedly process one or more program instructions until some conditio
Arlecino [84]

Answer:

Loop

Explanation:

Great question, it is always good to ask away and get rid of any doubts that you may be having.

Programmers use a(n) <u>loop</u> when they need the computer to repeatedly process one or more program instructions until some condition is met, at which time the <u>loop</u> ends.

<u><em>Loops</em></u> repeat a certain set of instructions until a certain condition is acuired and then exit out of the loop. There are a couple of different types of loops such as For Loop, While Loop, and Do-While loop. Each repeats a set of instructions but for a different set of times.

<u><em>For Loops</em></u> repeat for a fixed amount of Times or until the condition is met and it breaks out of the loop. Meanwhile,  <em><u>While</u></em> and <em><u>Do-While</u></em> loops keep repeating until the condition is me, but the Do-While checks the condition at the end of the loop.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

5 0
3 years ago
Can you answer this question?
patriot [66]

Answer:

To do this you'll need to use malloc to assign memory to the pointers used.  You'll also need to use free to unassign that memory at the end of the program using the free.  Both of these are in stdlib.h.

#include <stdlib.h>

#include <stdio.h>

#define SIZE_X 3

#define SIZE_Y 4

int main(void){

       int **matrix, i, j;

       // allocate the memory

       matrix = (int**)malloc(SIZE_X * sizeof(int*));

       for(i = 0; i < SIZE_X; i++){

               matrix[i] = (int *)malloc(SIZE_Y * sizeof(int));

       }

       // assign the values

       for(i = 0; i < SIZE_X; i++){

               for(j = 0; j < SIZE_Y; j++){

                       matrix[i][j] = SIZE_Y * i + j + 1;

               }

       }

       // print it out

       for(i = 0; i < SIZE_X; i++){

               for(j = 0; j < SIZE_X; j++){

                       printf("%d, %d:  %d\n", i, j, matrix[i][j]);

               }

       }

       // free the memory

       for(i = 0; i < SIZE_X; i++){

               free(matrix[i]);

       }

       free(matrix);

       return 0;

}

3 0
3 years ago
Other questions:
  • Brenda is a college student who enjoys downloading music, movies, and television shows from the Internet. She also uses the Inte
    7·1 answer
  • What is batch processing?
    12·1 answer
  • A parameter is a numerical measure that describes a characteristic of a sample. Choose One • 4 points True False
    6·1 answer
  • How do i get more coding programs
    14·2 answers
  • An organization’s SOC analyst, through examination of the company’s SIEM, discovers what she believes is Chinese-state sponsored
    12·1 answer
  • When troubleshooting firewalls, you should never attempt to repeat the problem because you could do more damage. T/F
    6·1 answer
  • Requirements description:
    6·1 answer
  • According to the domain name system (DNS), which of the following is a subdomain of the domain example.com?
    7·2 answers
  • A list contains the following items: Antelope, Baboon, Cheetah, Elephant, Giraffe, Hippo, Jackal, Lion, Okapi, Warthog. ​(a)​A b
    5·2 answers
  • What are the nuclear codes?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!