Question: I don't know how to have these 2 classes work together. (in Java please) B.1 Expense Class Implement Expense class inside a package called expenses

I don't know how to have these 2 classes work together. (in Java please)

I don't know how to have these 2 classes work together. (in

B.1 Expense Class Implement Expense class inside a package called expenses that contains: A private String data field service Type, e.g. "Electricity", "Gas, etc. A private String data field billDate, e.g. "Jan 4 2021". A private double (or Double) data field billAmount, e.g. 25.00. A private String data field dueDate, e.g. "Jan 30 2021". A private String data field payment Date .e.g. "Jan 20 2021". A private String data field paymentForm, e.g. "Credit Card", "Check, etc. A private String data field paymentRefNumber, e.g. 123456, etc. (Do not use your real reference information. The number may be composed of year, month, day, and any additional number, e.g. 20210101-9") A private double (or Double) data field named paymentAmount, e.g. 10.00. A private double (or Double) data field named balanceAmount, computing the difference between the billAmount and the paymentAmount for the expense. Methods that set and return the values for each variable. Note that for balanceAmount there should only be a "get" method, and not a "set" method. A constructor method receiving all the arguments required to create each expense. A print method printing the values of all variables in the class. B.2 MyExpenses Class Implement MyExpenses class inside a package called expenses that contains: An array called myExpenses where all expense objects are stored. An "init method where all expense objects are created. Each expense object needs to be stored in myExpenses array. All expense values need to be passed as 1 arguments when constructing each expense object. You need to include at least 5 different expense objects. A "print" method printing all the attributes for each expense object, the total amount of expenses and the total balance. The "main" method that calls the init and print methods

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!