To make a profit, a local store marks up the prices of its items by a certain percentage. Write a C++ program that reads the original price of the item sold, the percentage of the marked-up price, and the sales tax rate. The program then outputs the original price of the item, the percentage of the mark-up, the store’s selling price of the item, the sales tax rate, the sales tax, and the final price of the item. (The final price of the item is the selling price plus the sales tax.)
Write the Code:
/* Project: Store Profit Description: User inputs original price, markup percentage and sales tax rate. Program calculates full price, sales tax and final price. */ #include <iostream>; using namespace std; int main() { float wholesalePrice, markupPercent, taxPercent, retailPrice, taxAmount, finalPrice = 0; cout << "\nEnter wholesale price $"; cin >> wholesalePrice; cout << "\nEnter percentage of markup:"; cin >> markupPercent; cout << "\nEnter percentage of sales tax:"; cin >> taxPercent; cout << "\nOriginal (wholesale) price: $" << wholesalePrice; cout << "\nThe percentage of markup is " << markupPercent << "%"; retailPrice = wholesalePrice * (1 + (markupPercent * .01)); cout << "\nThe selling (retail) price is $" << retailPrice; cout << "\nThe sales tax rate is " << taxPercent << "%"; taxAmount = retailPrice * (taxPercent * .01); cout << "\nThe amount of sales tax for the item is $" << taxAmount; finalPrice = retailPrice + taxAmount; cout << "\nThe final price of the item is $" << finalPrice; return 0; }