Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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)
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 methodsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started