Question

Write a Java program that computes a business’s potential profits each year for 20 years using...

Write a Java program that computes a business’s potential profits each year for 20 years using the following assumptions:

  1. Gross profit in the first year is projected to be $20,000.
  2. Expenses in the first year are expected to be $35,000.
  3. Net profit or loss is gross profit minus expenses.
  4. Gross profits are expected to increase 10% each year.
  5. Expenses are expected to increase 4% each year.

Display the year, the gross profit, the expenses, and the net profit for each year. Use “printf” to make the output look uniform. Also display the year in which a net profit is first reported.

Validate all of your inputs

0 0
Add a comment Improve this question Transcribed image text
Answer #1

public class Main
{
   public static void main(String[] args)
   {
   //variable declaration and initialization
   float grossProfit = 20000;
   float expenses = 35000;
  
   //calculate net profit or loss
   float netProfitLoss = grossProfit - expenses;
   System.out.printf("\n\nYear 1:\nGross profit = %.2f\nExpenses = %.2f\nNet loss = %.2f", grossProfit, expenses, Math.abs(netProfitLoss));
   for(int i=1; i<20; i++)
   {
   //calculate gross profit
   grossProfit = grossProfit + grossProfit * 10 / 100;
  
   //calculate expenses
   expenses = expenses + expenses * 4 / 100;
  
   //calculate net profit or loss
   netProfitLoss = grossProfit - expenses;
  
   //display the result
   if(netProfitLoss<=0)
   {
   System.out.printf("\n\nYear %d:\nGross profit = %.2f\nExpenses = %.2f\nNet loss = %.2f", (i+1), grossProfit, expenses, Math.abs(netProfitLoss));
   }
   else
   {
   System.out.printf("\n\nYear %d:\nGross profit = %.2f\nExpenses = %.2f\nNet profit = %.2f", (i+1), grossProfit, expenses, Math.abs(netProfitLoss));
   }
   }
   }
}

OUTPUT:

Year 1:
Gross profit = 20000.00
Expenses = 35000.00
Net loss = 15000.00

Year 2:
Gross profit = 22000.00
Expenses = 36400.00
Net loss = 14400.00

Year 3:
Gross profit = 24200.00
Expenses = 37856.00
Net loss = 13656.00

Year 4:
Gross profit = 26620.00
Expenses = 39370.24
Net loss = 12750.24

Year 5:
Gross profit = 29282.00
Expenses = 40945.05
Net loss = 11663.05

Year 6:
Gross profit = 32210.20
Expenses = 42582.85
Net loss = 10372.65

Year 7:
Gross profit = 35431.22
Expenses = 44286.16
Net loss = 8854.94

Year 8:
Gross profit = 38974.34
Expenses = 46057.61
Net loss = 7083.27

Year 9:
Gross profit = 42871.77
Expenses = 47899.91
Net loss = 5028.14

Year 10:
Gross profit = 47158.95
Expenses = 49815.91
Net loss = 2656.95

Year 11:
Gross profit = 51874.85
Expenses = 51808.54
Net profit = 66.30

Year 12:
Gross profit = 57062.33
Expenses = 53880.88
Net profit = 3181.45

Year 13:
Gross profit = 62768.57
Expenses = 56036.12
Net profit = 6732.45

Year 14:
Gross profit = 69045.42
Expenses = 58277.56
Net profit = 10767.86

Year 15:
Gross profit = 75949.96
Expenses = 60608.66
Net profit = 15341.30

Year 16:
Gross profit = 83544.95
Expenses = 63033.01
Net profit = 20511.94

Year 17:
Gross profit = 91899.45
Expenses = 65554.34
Net profit = 26345.11

Year 18:
Gross profit = 101089.39
Expenses = 68176.51
Net profit = 32912.88

Year 19:
Gross profit = 111198.33
Expenses = 70903.57
Net profit = 40294.76

Year 20:
Gross profit = 122318.16
Expenses = 73739.71
Net profit = 48578.45


Add a comment
Know the answer?
Add Answer to:
Write a Java program that computes a business’s potential profits each year for 20 years using...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Solve it by using Compounded Interest Factors Tables A local planning commission has estimated the first cost of a new city- owened amusement park to be $35,000. They expect to improve the park by ad...

    Solve it by using Compounded Interest Factors Tables A local planning commission has estimated the first cost of a new city- owened amusement park to be $35,000. They expect to improve the park by adding new rides every year for the next 5 years at a cost of S6000 per year. Annual operating costs are expected to be $12,000 the first year; these will increase by $2000 per year until year 5. After that time, the operating expenses will remain...

  • Problem 4-17 The Haverly Company expects to finish the current year with the following financial results, and is devel...

    Problem 4-17 The Haverly Company expects to finish the current year with the following financial results, and is developing its annual plan for next year. Haverly Company Income Statement This Year ($000) 100.0 $80900 34792 $46108 Revenue COGS Gross Margin Expenses: Marketing Engineering Fin & Admin Total Exp. EBIT Interest * $17667 9799 4931 $32397 $13711 2007 $11704 5267 $ 5437 16.9 EBT Inc Tax olir ili Net Income $ 1546 908 Haverly Company Balance Sheet This Year ($000) ASSETS...

  • Exercise 2-3 Required: Compute 2014 earnings per share. (Extreme Edge had 50,000 shares of stock outstanding...

    Exercise 2-3 Required: Compute 2014 earnings per share. (Extreme Edge had 50,000 shares of stock outstanding in 2014). The various income categories mentioned above result from Extreme Edge's income statement presentation method. As noted, the Internet firm reported four expense categories, each of which resulted in a measure of profit (e.g., gross profit, income from continuing operations, pretax income, and net income). Managers refer to this type of disclosure as a multiple-step income statement. Conversely, a single-step income statement first...

  • THE YEARS 1-9 ARE NOT SUPPOSE TO BE THE SAME IN EACH YEAR'S FINAL CASH FLOW...

    THE YEARS 1-9 ARE NOT SUPPOSE TO BE THE SAME IN EACH YEAR'S FINAL CASH FLOW BECAUSE ITS INCORRECT. FOR INSTANCE, YEARS 1-9 ARE NOT SUPPOSE TO BE 7.227 EACH YEAR. RATHER, ITS SUPPOSE TO BE A DIFFERENT NUMBER EACH YEAR. You are a manager at Northern​ Fibre, which is considering expanding its operations in synthetic fibre manufacturing. Your boss comes into your​ office, drops a​ consultant's report on your​desk, and​ complains, "We owe these consultants $1.9 million for this​...

  • THE YEARS 1-9 ARE NOT SUPPOSE TO BE THE SAME IN EACH YEAR'S FINAL CASH FLOW...

    THE YEARS 1-9 ARE NOT SUPPOSE TO BE THE SAME IN EACH YEAR'S FINAL CASH FLOW BECAUSE ITS INCORRECT. FOR INSTANCE, YEARS 1-9 ARE NOT SUPPOSE TO BE 7.227 EACH YEAR. RATHER, ITS SUPPOSE TO BE A DIFFERENT NUMBER EACH YEAR. **** THIS IS NOT MY QUESTION BUT (MINE WILL BE BELOW THIS ONE) AN EXAMPLE ON HOW ITS DONE SO IT CAN GIVE YOU SOME GUIDANCE! EXAMPLE (NOT MY QUESTION): THIS IS MY QUESTION (its the same question just...

  • Cute Camel Woodcraft company's income statement reports data for its first year of operation. The firms...

    Cute Camel Woodcraft company's income statement reports data for its first year of operation. The firms CEO would like sales to increase by 25% next year. Given the results of the previous income statement calculations, complete the following statement. Question 1 available drop down answers. $30.00, $18.00, $12.00, $24.00 Question 2 available drop down answers, first blank. $16.74, $27.90, $31.00, $15.24. Second Blank. $18.77, $39.75, $20.27, $33.79 Question 3 available drop down answers, first blank. $9,548,000. $8,432,000. $19,200,000. $7,000,000 Second...

  • Please use EXCEL!!!!!! Using the information provided, construct a monthly cash budget for October through December...

    Please use EXCEL!!!!!! Using the information provided, construct a monthly cash budget for October through December 2014. Based on your analysis, will Noble enjoy a surfeit of cash, or require external financing? Construct a pro forma income statement for the first fiscal quarter of 2015 and a pro forma balance sheet as of December 31,2014. What is vour estimated external financine needed for December 31? 4 b 5 cDoes the December 31, 2014, estimated external financing equal your cash surplus...

  • The following contains a 3 part question, first question in done by me, assistance required in...

    The following contains a 3 part question, first question in done by me, assistance required in the second question (Statement of Financial Position), third question will be asked later in a separate request. Rita Mc Govern is starting her business in the hair care industry by launching Wonderful Hair Day (WHD). She has undertaken some initial analysis of the market and believes that she can sell 9,000 units of the WHD in the first 3 months of business. She is...

  • Options for dropdown 1: $12, $24, $18, or $30 Options for dropdown 2 in year 1:...

    Options for dropdown 1: $12, $24, $18, or $30 Options for dropdown 2 in year 1: $8.51, $7.00, $14.18 or $15.75 options for year 2: $8.92, $10.42, $17.37, $20.44 Options for dropdown 3 in year 1: $4,284,000, $3,750,000, $14,400.000, $4,851,000 options for year 2: $19,363,125, $6,172,125, $4,687,500, or $16,147,125 Options for dropdown 4 line 1: incorrect or correct and then for the last dropdown box is: all or all but one 3. Income statement The income statement, also known as...

  • Toler Company sells flags with team logos. Toler has fixed costs of $900,000 per year plus...

    Toler Company sells flags with team logos. Toler has fixed costs of $900,000 per year plus variable costs of $10.00 per flag. Each flag sells for $25.00. Read the requirements. Require 1 Requirements - X - to break even. First, se 1 = Target profit Rearrar In. The nu 1. Use the equation approach to compute the number of flags Toler must sell each year to break even. 2. Use the contribution margin ratio approach to compute the dollar sales...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT