Hello I need help with my c++ program,
A well-regarded manufacturer of widgets has been losing 4% of its sales each year. The company’s annual profit is 10% of sales. This year, the company has had $10 million in sales and a profit of $1million. Determine the expected sales and profit for the next 10 years. Your program should produce and display in the following form:
The output is this,
SALES AND PROFIT PROJECTION
YEAR EXPECTED SALES PROJECTED PROFIT
1 $10000000.00 $1000000.00
2 $ 9600000.00 $ 960000.00
3 - -
- - -
10 - -
Totals: $ - $ -
When posting code, please use code tags so that the code is readable
[code]
// code goes here
[/code]
You need to initialise variables when they are defined. totalSales and totalProfit aren't and have unknown initial values. Set them to 0. Also I think you need to keep the runing tally of ttalSales and totalProfit within the for loop. Perhaps:
Oh okay my bad, but the projected profit should be 10% of the expected sales, and expected sales on year 2 should be 9600000.00 applying the deduction of 4% to the 10 million sales and so for the following year.