Question: Write a Class named IPhone to accompany the financial class case study from chapter 9 of our BJP text. Your IPhone Class shall implement the

Write a Class named IPhone to accompany the financial class case study from chapter 9 of our BJP text. Your IPhone Class shall implement the Asset Interface, and meets the following specifications:
A. Three data fields (no more):
public static final double ANNUAL_DEPRECIATION =0.2; // fraction decline each year
private double originalCost; // in US dollars, fixed for each object
private int currentAge; // in years
B. Two constructors: IPhone(originalCost, currentAge) and a zero parameter constructor that calls this(0,0):
C. Methods required by Asset Interface:
market value that depreciates each year by amount given by ANNUAL_DEPRECIATION
profit that is market value minus original cost.
D. toString() method to allow printing an object similar to (example below):
"IPhone (5 years old )"

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!