I'd love some help with a hw problem

The problem says:

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.
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.


So far, this is where I am, and I'm pretty sure there's a ton of things wrong with the code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	double totalCost;
	double salary;
	double rent;
	double electric;
	
	int netprofit;
	int saledisc;


	cout << "Enter total cost of merchandise: " << endl;
	cin >> totalCost;

	cout << "Enter salary of all employees, including yourself: " << endl;
	cin >> salary;

	cout << "Enter rent amount: " << endl;
	cin >> rent;

	cout << "Enter Electric bill amount: " << endl;
	cin >> electric;

	cout << "Your net profit is " << (totalCost + salary + rent + electric << endl;




	system ("Pause");
	return 0;
}


I'd really like some help, I'm stuck.
Just consider the maths in the question and ignore all the other text. You need to:

Total up the expenses.
Work out an approximate mark up

Take an easy numbers example:


Let's say total costs are = 1000, with 250 of that cost being merchandise.

A good approximation of 10% profit, after applying 15% discount, is to simply increase by 20%. So we can see the merchandise should cost 1000 * 0.2 or 1200.

Dividing the wanted price by the purchase price we get:
1200 / 250 = 4.8

So the price should go up 480%.

Then put the arithmetic into the computer program.
Last edited on
closed account (jwkNwA7f)
cout << "Your net profit is " << (totalCost + salary + rent + electric << endl;
You are missing a ')'. It should be:
cout << "Your net profit is " << (totalCost + salary + rent + electric) << endl; system ("Pause"); It is not a good idea to use system("anything");, but to use this, you need to use #include <Windows.h> .

These are the problems I see right off.
Hope this helped!
Thanks a lot, both of you! I went ahead and did everything I needed to do, and it works perfectly, thanks.
could you upload the code im haveing some trouble
Topic archived. No new replies allowed.