Need help with this program

closed account (92w05Di1)
I'm having trouble with this program.
Here's the question.
Linda is starting a new cosmetic and clothing business and would like to make a net profit of approximately 10% after paying all the expenses, which include merchandise cost, store rent, employees’ salary, and electricity cost for the store.
She would like to know how much the merchandise should be marked up so that after paying all the expenses at the end of the year she gets approximately 10% net profit on the merchandise cost. Note that after marking up the price of an item she would like to put the item on 15% sale.

1. Write a program that prompts Linda to enter the total cost of the merchandise, the salary of the employees (including her own salary), the yearly rent, and the estimated electricity cost.
The program then outputs how much the merchandise should be marked up so that Linda gets the desired profit.






Here's what I have:



#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double cost;
double salary;
double rent;
double electricity;
int netprofit;
int x;

cout << "Enter total cost of merchandise: " << endl;
cin >> cost;
cout << "Enter salary of employees: " << endl;
cin >> salary;
cout << "Enter rent: " << endl;
cin >> rent;
cout << "Enter Electric bill: " << endl;
cin >> electricity;
x = (cost + salary + rent + electricity);
cout << "Your net profit is " <<1.1* 100*x / 85 << endl;

system("Pause");
return 0;
}
I'm having trouble with this program.

what's the trouble?
closed account (92w05Di1)
I get the whole 10% profit thing, but I don't know where/how to implement the whole 15% discount thing.
closed account (92w05Di1)
This is what I have now, but if you output it, you can see that the Merchandise Price and Merchandise 15% Sale Price are wrong. Can someone help me with this, please?

#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
void main()
{
double cost;
double salary;
double rent;
double electricity;
int netprofit;
int x;

cout << "Enter total cost of merchandise: " << endl;
cin >> cost;
cout << "Enter salary of employees: " << endl;
cin >> salary;
cout << "Enter rent: " << endl;
cin >> rent;
cout << "Enter Electric bill: " << endl;
cin >> electricity;
x = (cost + salary + rent + electricity);
std::cout << "Store Rent: " << std::right << std::setw(24) << setfill('.') << "$" << rent << std::endl;
std::cout << "Salary: " << std::right << std::setw(28) << setfill('.') << "$" << salary << std::endl;
std::cout << "Electricity: " << std::right << std::setw(23) << setfill('.') << "$" << electricity << std::endl;
std::cout << "Merchandise Cost: " << std::right << std::setw(18) << setfill('.') << "$" << cost << std::endl;
std::cout << "Net Profit: " << std::right << std::setw(26) << setfill('.') << "10%" << std::endl;
std::cout << "Merchandise Price: " << std::right << std::setw(17) << setfill('.') << "$" << (100*1.1) / 85 << std::endl;
std::cout << "Merchandise 15% Sale Price: " << std::right << std::setw(8) << setfill('.') << "$" << (electricity*1.1) / 85 << std::endl;
system("Pause");
}
I think Linda is being dishonest. So she wants to mark up prices and then pretend she's having a 15% sale? Am I getting that right?

so you want to multiply your cost by a factor that means after you deduct expenses and 15% you make a 10% profit

How about

double markup_percent = (((x * 1.1) / ( cost * 0.85) ) - 1.0) * 100.0;

That would give the answer for my interpretation of Linda's motives.

I think.
Topic archived. No new replies allowed.