Write an Expenses class that stores the monthly balance [a double], total of income (total of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write an Expenses class that stores the monthly balance [a double], total of income (total of all sales or incoming moneys) for the current month [a double], total of expenditure (total of all outgoing money) for the current month [a double]. The class should have a set method for the balance data field and get methods for all data fields. The class should also have methods for adding the amount of a sale to the balance, subtracting the amount of an expenditure from the balance, accumulating the total of all incoming money in the month, accumulating the total of expenditure in the month. The class will also need a method to calculate Keleven to be able to balance the expenses if necessary (see note below). What is Keleven? Even though Kevin wants the balance to be 0 or positive at the end of the month he recognises that sometimes he may have essential purchases at different times (for example, pizza, hot dogs or pie) which means he may spend more than he earns from the ice-cream sales (ie, the balance will be less than 0). To balance the accounts in his daytime job at Dunder Mifflin Kevin employs a unique accounting method he calls a Keleven; he believes that a Keleven can be used in your program to balance his expenses each month when needed. Keleven is the amount added to the balance at the end of the month to ensure that the balance becomes 0. Write a program to test the Expenses class by: creating an expense object for the current month with a starting balance of $0, entering sales and expenditures on the expense object for each week in the month. At the end of the month display the balance, the total of income, total of expenditure, and Keleven from the expense object. Ensure that appropriate validation of user input is implemented. Figures 3, 4, 5 represent example executions of the program to assist you understand what the program needs to do: How many weeks this month? 4 Sales & Expenditure for week 1: 200 300 Sales & Expenditure for week 2: 300 450 Sales & Expenditure for week 3: 350 250 Sales & Expenditure for week 4: 275 275 Month Balance: $-150.00 Total Sales: $1125.00 Total Expenses: $1275.00 Keleven: $150.00 Figure 3 How many weeks this month? 5 Sales & Expenditure for week 1: 200 200 Sales & Expenditure for week 2: 150 150 350 400 Sales & Expenditure for week 3: Sales & Expenditure for week 4: 400 350 Sales & Expenditure for week 5: 200 200 Month Balance: $0.00 Total Sales: $1300.00 Total Expenses: $1300.00 Keleven: $0.00 Figure 4 How many weeks this month? Sales & Expenditure for week 1: 300 200 Sales & Expenditure for week 2: 450 300 Sales & Expenditure for week 3: 250 350 Sales & Expenditure for week 4: 275 275 Month Balance: $150.00 Total Sales: Keleven: $1275.00 Total Expenses: $1125.00 $0.00 Figure 5 Write an Expenses class that stores the monthly balance [a double], total of income (total of all sales or incoming moneys) for the current month [a double], total of expenditure (total of all outgoing money) for the current month [a double]. The class should have a set method for the balance data field and get methods for all data fields. The class should also have methods for adding the amount of a sale to the balance, subtracting the amount of an expenditure from the balance, accumulating the total of all incoming money in the month, accumulating the total of expenditure in the month. The class will also need a method to calculate Keleven to be able to balance the expenses if necessary (see note below). What is Keleven? Even though Kevin wants the balance to be 0 or positive at the end of the month he recognises that sometimes he may have essential purchases at different times (for example, pizza, hot dogs or pie) which means he may spend more than he earns from the ice-cream sales (ie, the balance will be less than 0). To balance the accounts in his daytime job at Dunder Mifflin Kevin employs a unique accounting method he calls a Keleven; he believes that a Keleven can be used in your program to balance his expenses each month when needed. Keleven is the amount added to the balance at the end of the month to ensure that the balance becomes 0. Write a program to test the Expenses class by: creating an expense object for the current month with a starting balance of $0, entering sales and expenditures on the expense object for each week in the month. At the end of the month display the balance, the total of income, total of expenditure, and Keleven from the expense object. Ensure that appropriate validation of user input is implemented. Figures 3, 4, 5 represent example executions of the program to assist you understand what the program needs to do: How many weeks this month? 4 Sales & Expenditure for week 1: 200 300 Sales & Expenditure for week 2: 300 450 Sales & Expenditure for week 3: 350 250 Sales & Expenditure for week 4: 275 275 Month Balance: $-150.00 Total Sales: $1125.00 Total Expenses: $1275.00 Keleven: $150.00 Figure 3 How many weeks this month? 5 Sales & Expenditure for week 1: 200 200 Sales & Expenditure for week 2: 150 150 350 400 Sales & Expenditure for week 3: Sales & Expenditure for week 4: 400 350 Sales & Expenditure for week 5: 200 200 Month Balance: $0.00 Total Sales: $1300.00 Total Expenses: $1300.00 Keleven: $0.00 Figure 4 How many weeks this month? Sales & Expenditure for week 1: 300 200 Sales & Expenditure for week 2: 450 300 Sales & Expenditure for week 3: 250 350 Sales & Expenditure for week 4: 275 275 Month Balance: $150.00 Total Sales: Keleven: $1275.00 Total Expenses: $1125.00 $0.00 Figure 5
Expert Answer:
Answer rating: 100% (QA)
import javautil Expend class class Expend private double monthlyBalance private double totalIncome private double totalExpenditure public Expenddefaul... View the full answer
Related Book For
Financial Reporting Financial Statement Analysis and Valuation
ISBN: 978-0324302950
6th edition
Authors: Clyde P. Stickney
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
What are some ways that the antibody-protein complex can be visualized in ELISA or western blots?
-
Cybersecurity is an area of increasing concern. The National Security Agency (NSA) monitors the number of hits at sensitive websites. When the number of hits is much larger than normal, there is...
-
(a) Sketch the graph of the function, highlighting the part indicated by the given interval, (b) Write a definite integral that represents the arc length of the curve over the indicated interval and...
-
Use information from Section 6.7 to estimate which form of electromagnetic radiation is the lowest energy ionizing radiation. Data from section 6.7 When we first introduced the concept of the...
-
Determine Cash Balance Presented below is a number of independent situations. For each individual situation, determine the amount that should be reported as cash. If the item(s) is not reported as...
-
Laverne owns 100% stock of the Pizza Bowl, Inc. (PB), which operates a classy combination bowling alley/pizza parlor. Her basis in the stock is $24,000. In its first year of existence, PB earned...
-
New University plans to issue a $ 2,000,000 bond. The money is to buy equipment for its physics laboratories. The bond matures in 10 years, and requires semiannual interest payments. The stated...
-
Q4 :( 8points) a) For the following circuit, if a sinusoidal signal with a peak value of 10 V is applied to the input.Detemine the output voltage and sketch the input and output voltages together. 15...
-
Suppose the demand curve for iPads takes the functional form: Q^d(P) = 500 10P; what is the own price elasticity of demand when the price is $30? Is the own price elasticity of demand for iPads...
-
What is included in the employee's job description?
-
In current cost accounting (CCA), assets are valued at market buying prices while profit are calculated by allocation based on current cost. Discuss TWO (2) criticisms of CCA based on the above...
-
Consider a monopolist with the (inverse) demand function: Pb = 385 - 13 Qb. Given an increasing marginal cost: mc = 36 + 4 Q, how much DWL is created ? (Assume fixed costs = 13 .)
-
A company manufactures two products X and Y whose profit contributions are Rs . 1 0 and Rs . 2 0 respectively. Product X requires 5 hours on machine I, 3 hours on machine II and 2 hours on machine...
-
1. Name the vessel that brings blood out of the kidney and back to the heart. 2. Name the vessel that brings blood into the kidney. 3. Name the inner layer of the kidney. 4. Name the duct that brings...
-
An investor sells a European call on a share for $4. The stock price is $47 and the strike price is $50. Under what circumstances does the investor make a profit? Under what circumstances will the...
-
U. S. Steel Corporation derives most revenues from manufacturing a wide variety of steel products. The steel industry in the United States has experienced intense foreign competition in the past...
-
The weighted average cost-flow assumption is a commonly used technique to value inventory and determine cost of goods sold. It falls between LIFO and FIFO as to the differential effect on inventory...
-
Prior to Year 14, Borden, Inc. derived approximately 75 percent of its revenues from branded food products and 25 percent from packaging and industrial products. The geographical sales mix comprised...
-
In 2019, Maggy (34 years old) is an employee of YBU Corp. YBU provides a 401(k) plan for all its employees. According to the terms of the plan, YBU contributes 50 cents for every dollar the employee...
-
Matthew (48 at year-end) develops cutting-edge technology for SV Inc., located in Silicon Valley. In 2019, Matthew participates in SVs money purchase pension plan (a defined contribution plan) and in...
-
Paris participates in her employers nonqualified deferred compensation plan. For 2019, she is deferring 10 percent of her $320,000 annual salary. Assuming this is her only source of income and her...
Study smarter with the SolutionInn App