Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

For each used car a salesperson sells, the commission is paid as follows: $20 plus 30% of the selling

price
in excess of the cost of the car.

Typically, the minimum selling price of the car is the cost of the car plus $200 and the maximum selling
price is the cost of the car and $2,000.

Instructions

Write a program that prompts the user to enter:

1.The salesperson’s fixed commission

2.The percentage of the commission

3.The purchasing cost of the car

4.The minimum and maximum amount to be added to the purchasing cost to determine the minimum
and maximum selling price

The program should output:

1.The minimum and maximum selling price of the car

2.The salesperson’s commission range

#include <iostream>

using namespace std;

int main() {

double excessH;

double excessL;

double price;

double comm;

double percent;

double NpriceH;

double NpriceL;

double commH;

double commL;

cout << "Enter the price of the car ";

cin >> price;


cout << "Enter the minimum excess ";

cin >> excessL;

cout << "Enter the maximum excess";

cin >> excessH;

cout << "Enter the commission rate ";

cin >> comm;

cout << "Enter the commission percentage ";

cin >> percent;

NpriceH = price+excessH;

NpriceL = price+excessL;

commH = (percent/100)*excessH+comm;

commL = (percent/100)*excessL+comm;

cout << "Your maximum selling price is " << NpriceH;

cout << "Your minimun selling price is " << NpriceL;

cout << "Your maximum commission is " << commH;

cout << "Your minimum commission is " << commL;

return 0;

You might also like