This is a continuation of Exercise 2 from week 7 practical exercises. Import a copy of the two java files, Expenses.java and ExpensesDemo.java that you developed in Exercise 2 Week 7 into your week 8 project in Eclipse. You should also use the MalonesCones.txt file from week 7 to test this program. A second version of MalonesCones.txt (containing more months) is also provided in the zip file for this week's exercises.

a. Modify your solution to use an array of Expenses objects. That is, each month of data that is read from the file will be stored as an Expenses object in the array. Your array size should be 12 to allow for expenses for up to one year. You cannot assume that there will always be 12 months of values in the file (there may be more or less).

b. The program should create the on-screen report as per part b in week 7 exercise 2 but the report is to be generated by processing the array rather than processing the input file.

c. Add a new method to your program to calculate the average (mean) of monthly Kelevens from the array of Expenses objects. Display the average Keleven as shown in figure 1.

Figure 1: see image.

d. The program should create the text file as per part c in week 7 exercise 2 but this file is to be generated by processing the array rather than processing the input file.

Test the program with different sized files with different sets of numbers. Make sure your code works correctly if the file isn't found, if it exists but doesn't have any data in it, or, if the file has too many values to fit into the array. Your solution must incorporate appropriate methods utilising appropriate parameter passing.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.