C++ The local precious metal retailer needs a program to calculate the amount th
ID: 3881352 • Letter: C
Question
C++
The local precious metal retailer needs a program to calculate the amount that a sales person will get paid per order for selling precious metal for them. The company has only four (4) types of metal at one time.
The cost of per ounce is:
Type 1 --> $125.56
Type 2 --> $327.48
Type 3 --> $79.24
Type 4 --> $452.14
The amount that the sales person gets paid is based off of the order amount. The commission to our sales person is 16%. Your program needs to calculate the amount that a person will get paid, what the taxes will be on his income from this sale and display all results in the required format including the following:
Sales person's name
Amount of ounces of the order
Total cost of the order
Commission the salesperson will get paid for that order
Income tax deducted
SS tax deducted
Net income they will receive
The sales person will enter in what type of metal was sold along with the number of ounces purchased. Your program will need to do all of the calculations for the requested output.
Explanation / Answer
#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
string name;
double m1, m2, m3, m4;
double cost;
double SS;
double IT;
cout << "Enter seller name: " ;
cin >> name;
cout << "Enter ounces of Type 1 sold @ $125.56: ";
cin >> m1;
cout << "Enter ounces of Type 2 sold @ $327.48: ";
cin >> m2;
cout << "Enter ounces of Type 3 sold @ $79.24: ";
cin >> m3;
cout << "Enter ounces of Type 4 sold @ $452.14: ";
cin >> m4;
cost = m1 * 125.56 + m2 * 327.48 + m3 * 79.24 + m4 * 452.14;
SS = cost * 0.15; //15 % of cost
IT = cost * 0.4; //30 % of inclome
cout << "Seller name: " ;
cout << name << endl;
cout << "Ounces of Type 1 sold @ $125.56: ";
cout << m1 << "Oz" << endl;
cout << "Ounces of Type 2 sold @ $327.48: ";
cout << m2 << "Oz" << endl;
cout << "Ounces of Type 3 sold @ $79.24: ";
cout << m3 << "Oz" << endl;
cout << "Ounces of Type 4 sold @ $452.14: ";
cout << m4 << "Oz" << endl;
cout << "Total cost: $";
cout << cost << endl;
cout << "SS tax: $";
cout << SS << endl;
cout << "Income tax: $";
cout << IT << endl;
cout << "Net income: $";
cout << (cost - SS -IT) << endl;
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.