Question
A company wants to be able to produce reports, for any year, of the annual profit for each of its three divisions, and for the
A company wants to be able to produce reports, for any year, of the annual profit for each of its three divisions, and for the company in total. The company tracks the sales of each division by quarter, but tracks the expenses on an annual basis only. Profit is calculated as: sales less expenses, less tax on sales less expenses.
Declare in main a 3 by 5 array for the company’s sales and expenses (three divisions, each with four quarters of sales and an annual expense).
Also, declare an empty vector for the three divisions' tax rates.
Have the user repeatedly enter a year for which reports are to be produced (unknown number of years), call the two functions described below and for the year entered, display the year and the company’s annual sales, annual expenses, and annual profit, and repeat until the user is finished.
The program will have two functions:
1) Have the user fill the sales and expenses array with quarterly sales for each division and its associated annual expenses. Validate that the entries are zero or greater. Also have the user store each division's tax rate in the vector.
2) Calculate and display each division’s annual sales, annual expenses, and profit (sales less expenses, minus tax on sales less expenses), and using reference variables accumulate and return to main the company’s annual sales, annual expenses and profit.
The tax rates for the three divisions are: 5.5%, 6.1%, and 4.8% (same for all years).
Provide screen prints for 2 years with the following data:
2012
division #1/sales: $25,000; $23,000; $28,000; $27,500/expenses: $81, 250
division #2/sales: $15,000; $13,500; $20,000; $17,250/expenses: $71, 050
division #3/sales: $29,000; $33,000; $38,000; $25,500/expenses: $100, 100
2015
division #1/sales: $25,100; $23,000; $25,000; $26,500/expenses: $91, 250
division #2/sales: $12,000; $11,500; $20,000; $13,250/expenses: $171, 050
division #3/sales: $28,000; $30,000; $39,000; $27,500/expenses: $130, 100
Step by Step Solution
3.47 Rating (154 Votes )
There are 3 Steps involved in it
Step: 1
include include include using namespace std void getDataint yeardoubl...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started