Question: java Debt ratio i s a ratio o f total debt t o total assets, calculated using the formula: Total Debt ? ? Total Assets
java
Debt ratio a ratio total debt total assets, calculated using the formula:
Total Debt Total Assets
The DebtMeasure.java file contains existing code that collects input for totalDebt and totalAssets, then passes the inputs into the Debt object's setDR method. The code then returns the debtRatio using the Debt object's getDR method.
Write code the Debt class Debt.java that has the following field and methods:
debtRatio: private field type double
calculateDR: a private helper method with two parameter variables type double for totalDebt and totalAssets
The calculateDR method should calculate the debt ratio and assign the results the debtRatio field.
Use the method signature private void calculateDR totalDebt, double totalAssets
getDR: public accessor method that returns the debtRatio field value
setDR: public mutator method that passes the inputs, totalDebt and totalAssets, the Debt class
Ensure your program output matches the example formatting below and works for a variety input values.
the input :
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
