Problem Solving using the Simple Sequence Structure: Consider the sales operatio
ID: 3888103 • Letter: P
Question
Problem Solving using the Simple Sequence Structure: Consider the sales operations of a large department store. A sales manager delegates responsibilities to supervisors in various departments. Each supervisor has to prepare the weekly sales report for their department that will give the salesperson’s pay for the week. Usually a salesperson’s pay is determined in part by how much he or she has sold in a given week. In your problem the sales will be divided into two categories: those items sold at regular price and those items sold at a reduced or sale price which will be the input values. Each person will be paid a base amount of $400 as well as a percentage of his or her weekly sales. The percentage (commission) will be 6 percent on the sales of regular-priced items and 3 percent on sales of sale-priced items. The supervisors have decided that there needs to be 2 inputs for the two weekly sales totals for an employee. The regular commission will be computed by multiplying the regular sales amount by 6 percent. The sales commission will be computed by multiplying the reduced sales amount by 3 percent. The total pay will be computed by adding all amounts together: base pay, regular commission and sales commission and lastly they will print or display the total pay for that employee. Submit your pseudocode in the box below. Make sure that you DECLARE ALL VARIABLES and USE THE MODULAR FORMAT. Feel free to type your program in Word and then Copy and Paste your results here.
Explanation / Answer
#include<iostream>
using namespace std;
int main(){
double base_pay;
double regular_sale1, regular_sale2;
double reduced_sale1, reduced_sale2;
base_pay = 400;
cout << "Enter the regular sale amount for week1: " << endl;
cin >> regular_sale1;
cout << "Enter the reduced sale amount for week1: " << endl;
cin >> reduced_sale1;
cout << "Enter the regular sale amount for week2: " << endl;
cin >> regular_sale2;
cout << "Enter the reduced sale amount for week2: " << endl;
cin >> reduced_sale2;
double total_pay = base_pay + (regular_sale1 + regular_sale2) + 0.06 * (regular_sale1 + regular_sale2);
total_pay = total_pay + (reduced_sale1 + reduced_sale2) + 0.03 * (reduced_sale1 + reduced_sale2);
cout << "Total pay : $" << total_pay << endl;
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.