Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Java program that defines the CarLease class with member variables and a getPayment method It also i...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