Question


Write a program that asks the user to enter the price without tax of one kilogram of tomatoes,the number of kilograms you want to buy and the tax in percent units. The program must write the total price including taxes.
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.)

Program Code:

//tomatoes
#include<iostream>
using namespace std;
int main()
{
double price , nkg , tax ;
double bill , x , profit ,bill_profit , sales_tax ;
cout<<"Enter the price of tomatoes per Kg without tax:  ";
cin>>price;
cout<<"\nEnter number of kg you want to buy:             ";
cin>>nkg;
cout<<"\nEnter the tax in percents :                     ";
cin>>tax;
sales_tax =  (tax / 100) ;
x = tax * (price / 100); // tax per kg 
bill = (price + x) * nkg ; // origianl price with tax of total kgs 
profit = 5 * (price / 100);  // let 5% percent is profit per kg per each item of shopkeeper
bill_profit = (price + x + profit)  * nkg; // selling price with shopkeeper profit
cout<<"\n\nBill with original price  :  "<<bill; 
cout<<"\n\nMarked up price per kg:  "<<profit;
cout<<"\n\nBill with Profit of Shopkeeper or store selling price:  "<<bill_profit;
cout<<"\n\nSales Tax: "<<sales_tax;
return 0;
}

Output:

.exe file



No comments:

Post a Comment

Please disable your ad blocker to support this website.

Our website relies on revenue from ads to keep providing free content.