### Help HW

The program runs and everything. So, I am guessing I am just missing something simple?
Last edited on
The details given indicate that there is to be a net profit of 10%.

Your code seems to allow for a net profit of zero percent. Your code is working out how much markup to apply to the goods to break even. You're not meant to be breaking even. You're meant to calculate how much to charge to make a profit.
Hm, I see. Thank-you for that!

I will try again and see what I can come up with.
Still can't figure out the formula. I feel like I am overthinking lol
 ``1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253`` ``````#include #include int main() { std::cout << "1\n" << std::flush ; double merchTotal; std::cout << "Enter the total cost of the merchandise, please. "; std::cin >> merchTotal; std::cout << merchTotal << '\n' ; double salary; std::cout << "Enter the total salary amount (including yours), please. "; std::cin >> salary; std::cout << salary << '\n' ; double rent; std::cout << "Enter the yearly rent cost, please. "; std::cin >> rent; std::cout << rent << '\n' ; double elect; std::cout << "Enter the estimated electricity cost, please. "; std::cin >> elect; std::cout << elect << '\n' ; const double totalCost = merchTotal + salary + rent + elect ; if( totalCost <= 0.0 ) { // sanity check std::cout << "bad inoput\n" ; return 1 ; } // note: would like to make a net profit of approximately 10% const double nett_price = totalCost * 1.10 ; // note: after marking up the price of an item she would like to put // the item on 15% sale. const double markedup_price = nett_price * 100.0 / ( 100.0 - 15.0 ) ; // sale price (for 15% sale) const double sale_price = markedup_price * ( 100.0 - 15.0 ) / 100 ; const double percent_nett_profit = (sale_price-totalCost) / totalCost * 100 ; std::cout << "\n\n" << std::fixed << std::setprecision(2) // print two digits after the decimal point << " total cost: " << totalCost << '\n' << " nett price: " << nett_price << '\n' << " marked_up_price: " << markedup_price << '\n' << "sale price after 15% discount: " << sale_price << '\n' << " nett profit: " << percent_nett_profit << "%\n" ; }``````

http://coliru.stacked-crooked.com/a/06e6c47146df0dc3
Thank you for that. I broke it down and attempted to translate the formula being used there lol, but to no avail. Haha
As you have now discovered, programming is thinking. It's thinking about the problem and the context, understanding it, and then efficiently solving it in a way that can be expressed programatically. The bit at the end, when syntax is typed in, isn't the programming bit. That's just writing. Programming is thinking.
So, if I add up all the expensive and times it by 1.10
E * 1.10 --> Price marked up for Profit
Then if I do
E * .15 (markup up amount)
Then add that to the profit
Profit + markup

This is what I came up with... not sure if it makes any sense. Going to try it out in a bit, but I am at work typing this during my break. By the time I get off, this assignment would be due in the next 30 min from then

ahhhhh some save me lol. It's been like 4 days hahah man I suck.
Any one else willing to help? I appreciate everyones time!
Topic archived. No new replies allowed.