114k views
1 vote
Write a C program

A well-regarded manufacturer of widgets has been losing 4 percent of its sales each year. The annual profit for the firm is 10 percent of sales. This year the firm has had $10 million in sales and a profit of $1 million. Determine the expected sales and profit for the next 10 years. Your program should complete and produce a display as follows: (C program)

SALES AND PROFIT PROJECTION
----------------------------------------------
YEAR EXPECTED SALES PROJECTED PROFIT
--------- ------------------------- ------------------------
1 $10,000,000.00 $1,000,000.00
2 $9,600,000.00 $960,000.00
3 .. .
.. ..
... .. .. ..
... .. .. ..
... .. .. ..
.... .. .. ..
.. .. ..
10 .. .
------------------------- -------------------------
TOTALS: $ $

1 Answer

5 votes

Final answer:

To determine the expected sales and profit for the next 10 years, we can calculate the expected sales and profit for each year using the given percentages of sales loss and annual profit. The results can be displayed using a table in a C program.

Step-by-step explanation:

To determine the expected sales and profit for the next 10 years, we can use the given information that the well-regarded manufacturer of widgets is losing 4% of its sales each year and its annual profit is 10% of sales.

Using these percentages, we can calculate the expected sales and profit for each year by multiplying the previous year's sales and profit by (1 - 4%) and (1 + 10%) respectively. We can then display the results using a table.

Here is the C program that implements this:

#include<stdio.h>

int main() {
double sales = 10000000.00, profit = 1000000.00;

printf("SALES AND PROFIT PROJECTION\\----------------------------------------------\\");
printf("YEAR\t\tEXPECTED SALES\t\tPROJECTED PROFIT\\");

for(int i = 1; i <= 10; i++) {
sales = sales * 0.96;
profit = profit * 1.1;
printf("%d\t\t$%.2lf\t\t\t$%.2lf\\", i, sales, profit);
}

printf("\\TOTALS:\t\t\t$%.2lf\t\t$%.2lf\\", sales, profit);

return 0;
}

User Tladuke
by
6.7k points