Question: 1. Write a class called CarLease which has 5 member variables: cost, residualValue, term, tax, rate This class should have a member method getPayment
1. Write a class called CarLease which has 5 member variables: cost, residualValue, term, tax, rate This class should have a member method getPayment which returns the payment amount after calculating it using the following formula: 1. 1. depreciation = (cost - residualValue) / term interest = (cost + residualValue) * (rate) totalTax = (depreciation + interest) * tax leasePayment = depreciation + interest + total Tax Write a driver which: a. Read 5 inputs via the Scanner (Use the "Test Values") b. Declares/initializes CarLease object C. Outputs the payment using JOptionPane Test Values: Input (Scanner): Capitalized Cost = $25,000 Residual Value = $12,500 Term = 36 Months Tax = 7% Interest Rate = .0029 Output (JOptionPane): Lease Payment = $488
Step by Step Solution
There are 3 Steps involved in it
To solve this problem youll need to implement a class called CarLease and a driver program that uses this class Heres a stepbystep solution Step 1 Def... View full answer
Get step-by-step solutions from verified subject matter experts
