Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can I get a new java code for the below question? Thanks One of the accountant's at Dunder Mifflin, Kevin Malone, investigates the option of

Can I get a new java code for the below question? Thanks

image text in transcribedimage text in transcribed

One of the accountant's at Dunder Mifflin, Kevin Malone, investigates the option of obtaining a bank loan to help pay off his gambling debt (https://www.youtube.com/watch?v=J1LvfXX9Uhs ). He tells the bank that he intends to use the loan to start an ice-cream business, called Malone's Cones, which will sell delicious ice-cream such as Fudge the Magic Dragon. Kevin needs a simple program that keeps track of his monthly expenditure for the business so that he doesn't accidently spend too much of the money - the balance at the end of the month should be either or a positive value if he sells at least as much as he spends. 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). Note on Keleven: Even though Kevin wants the balance to be 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 Dunder Mifflin accounts 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? 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 Sales & Expenditure for week 3: 350 400 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: 309 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: $1275.00 Total Expenses : $1125.00 Keleven: $0.00 Figure 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

Why is restructuring the most controversial credit event?

Answered: 1 week ago

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago