Design a class that maintains expenses Solved

20.00 $

Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . zip solution files instantly, after Payment


5/5 - (1 vote)
Design a class that maintains expenses. It should contain the following:ExpenseAmount – array of 4 float values (Review section 13.12 from last week)
Create a public TotalExpense method that sums the values in the ExpenseAmount array.2. Create a getter method to return the ExpenseAmount Array. You still need to set the expense values and can do that by adding a method that allows you to set the value at a specific index for the array.** At this point, it may be worthwhile to create your own test program to confirm the methods work as expected.3. Modify the ” Pet Food Company’s quarterly summarized activity ” class to use the above ExpenseMaintenance Class instead of a float for total expenses.4. This program should behave similar to Assignment 1, but instead of asking for a total expense for each instance, it will prompt for 4 expenses and display the calculated total expense.