Question

Summary

In this lab, you complete a prewritten C++ program that calculates an employee's productivity bonus and prints the employee's name 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.

MindTap- Cengage Learning -Mozilla Firefox ⓘ https://ng cengage.com stat /nbu evo/index.html?deploymentid-574532 19 1 2501212MindTap- Cengage Learning -Mozilla Firefox ⓘ https://ng cengage.com stat /nbu evo/index.html?deploymentid-574532 19 1 2501212MindTap - Cengage Learning - Mozilla Firefox ⓘ https://ngcengage.com/stati dex.html?deploymentid-574532 191250121250466990554MindTap- Cengage Learning -Mozilla Firefox ⓘ https://ng cengage.com/statinbuevo/index.html?deploymentid-574532 19125012125046

       

1 0
Add a comment Improve this question Transcribed image text
✔ Recommended Answer
Answer #1

#include
#include

using namespace std;
void houseKeeping();
void detailLoop();
void endOfJob();

string employeeFirstName;
string empoyeeLastName;
double numTransactions;
double shifts;
double dollarValue;
double score;
double bonus;
  
const double Bonus_1 = 50.0;
const double Bonus_2 = 75.0;
const double Bonus_3 = 100.0;
const double Bonus_4 = 200.0;

int main()
{
houseKeeping();
detailLoop();
endOfJob();

return 0;
}

void houseKeeping() {

cout << "Enter employee's first name:";
cin >> employeeFirstName;
  
cout << "Enter employee's last name:";
cin >> empoyeeLastName;
  
cout << "Enter number of shiftes:";
cin >> shifts;
  
cout << "Enter number of transactions:";
cin >> numTransactions;
  
cout << "Enter dollar value of transaction:";
cin >> dollarValue;
}

void detailLoop() {
score = (dollarValue/numTransactions)/shifts;
if (score <= 30.0) {
bonus = Bonus_1;
}
else if (score > 30.0 && score < 70.0) {
bonus = Bonus_2;
}
else if (score > 69.0 && score < 200.0) {
bonus = Bonus_3;
}
else {
bonus = Bonus_4;
}
  
}

void endOfJob() {
cout << "Employee's name: " << employeeFirstName << " " << empoyeeLastName << endl;
cout << "Employee's Bonus: " << bonus << endl;
}

The output of the program is in the image belowEnter employees first name:Alen Enter employees last name: Joe Enter number of shiftes:5 Enter number of transactions:10 En

if you have any doubt then you can ask in the comment section and please like the answer

Add a comment
Know the answer?
Add Answer to:
In this lab, you complete a prewritten C++ program that calculates an employee's productivity bonus and prints the employee's name and bonus
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • In this lab, you complete a prewritten C++ program that calculates an employee’s productivity bonus and...

    In this lab, you complete a prewritten C++ program that calculates an employee’s productivity bonus and prints the employee’s name 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 <=30 $50 31–69 $75 70–199 $100 >= 200 $200 Instructions Ensure the file named...

  • Multiple Conditional Statements Summary In this lab, you complete a Python program that calculates an employee's...

    Multiple Conditional Statements Summary In this lab, you complete a Python program that calculates an employee's annual bonus. Input is an employee's first name, last name, salary, and numeric performance rating. If the rating is 1, 2, or 3, the bonus rate used is .25, .15, or .1 respectively. If the rating is 4 or higher, the rate is 0. The employee bonus is calculated by multiplying the bonus rate by the annual salary. Variables have been declared for you,...

  • Please write the following program in Java That last idea at PicoSoft didn't work out too...

    Please write the following program in Java That last idea at PicoSoft didn't work out too well … management has a massive public relations disaster on their hands, and thus they decide to revise the bonus structure, as well as give eveyone some additional vacation time. Write a program that reads in (from the keyboard) the following information about an employee: Last name First name Years worked (a whole number) Annual salary An employee's vacation time is based upon the...

  • please help, In this lab, you complete a C++ program with the provided data files. The program calculates the amount of...

    please help, In this lab, you complete a C++ program with the provided data files. The program calculates the amount of tax withheld from an employee’s weekly salary, the tax deduction to which the employee is entitled for each dependent, and the employee’s take- home pay. The program output includes state tax withheld, federal tax withheld, dependent tax deductions, salary, and take-home pay. Instructions Ensure the source code file named Payroll.cpp is open in the code editor. Variables have been...

  • For this lab you will write a small program that prints a few "shapes" using asterisks....

    For this lab you will write a small program that prints a few "shapes" using asterisks. Your program will prompt the user to select a shape by entering a number (square or triangle for B grade, add the zig- zag for the A grade). It will then prompt for the size, and then if a square or triangle is selected it will prompt for "not filled" or "filled", and if azig-zag is selected it will prompt for the number of...

  • c++ CSI Lab 6 This program is to be written to accomplish same objectives, as did...

    c++ CSI Lab 6 This program is to be written to accomplish same objectives, as did the program Except this time we modularize our program by writing functions, instead of writing the entire code in main. The program must have the following functions (names and purposes given below). Fot o tentoutefill datere nedefremfite You will have to decide as to what arguments must be passed to the functions and whether such passing must be by value or by reference or...

  • In C++ write a complete and correct x++ program that generates student email addresses and prints...

    In C++ write a complete and correct x++ program that generates student email addresses and prints them to the screen based upon the data found in an input file, called students . txt. Each line of the space, followed by the student’s last name. Every email address is to be of the form [email protected]. In general, each username has four parts in this order: (i) the student; last name in lowercase letters; (ii) a number between 10- 99 generated at...

  • In this project you will write a C++ program that simulates the purchase of a single...

    In this project you will write a C++ program that simulates the purchase of a single item in an online store. What to do Write a C++ program that: 1. Prints out a welcome message. 2. Prompts the user for the following information: (a) Their first name (example: Roger) (b) Their last name (example: Waters) (c) The name of the product (example: Brick) (d) The unit price of the product (example: 1.99) (e) The quantity to buy (example: 200) (f)...

  • Swapping Values in python Summary In this lab, you complete a Python program that swaps values...

    Swapping Values in python Summary In this lab, you complete a Python program that swaps values stored in three variables and determines maximum and minimum values. The Python file provided for this lab contains the necessary input and output statements. You want to end up with the smallest value stored in the variable named first and the largest value stored in the variable named third. You need to write the statements that compare the values and swap them if appropriate....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT