Suppose you have the interface Maintenance, below. There may be many classes such as Bulldozer, Excavator,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Suppose you have the interface Maintenance, below. There may be many classes such as Bulldozer, Excavator, or Loader that implement this interface. interface Maintenance { } double getAnnual Cost (); String getDescription(); Create a class Expenditures that represents a list of any kinds of yearly Maintenance. It has the methods below, plus a no-argument constructor that creates an empty list. You may forego import statements. // adds a Maintenance to this Expenditures public void addItem (Maintenance m) // finds the total cost of all annual maintenance in this. // Expenditures (0 if empty) public double findTotalPrice () // returns the maintenance cost of the first item in the // list that has the given description; returns if no // matching item is found public double findCost(String desc) // removes most recently added item; does nothing if the // list is empty public void remove () public class Expenditures { Suppose you have the interface Maintenance, below. There may be many classes such as Bulldozer, Excavator, or Loader that implement this interface. interface Maintenance { } double getAnnual Cost (); String getDescription(); Create a class Expenditures that represents a list of any kinds of yearly Maintenance. It has the methods below, plus a no-argument constructor that creates an empty list. You may forego import statements. // adds a Maintenance to this Expenditures public void addItem (Maintenance m) // finds the total cost of all annual maintenance in this. // Expenditures (0 if empty) public double findTotalPrice () // returns the maintenance cost of the first item in the // list that has the given description; returns if no // matching item is found public double findCost(String desc) // removes most recently added item; does nothing if the // list is empty public void remove () public class Expenditures {
Expert Answer:
Answer rating: 100% (QA)
Answer The Maintenance is a interface which has 2 methods are getAnnualCost and getDescription publi... View the full answer
Related Book For
Systems analysis and design
ISBN: 978-0136089162
8th Edition
Authors: kenneth e. kendall, julie e. kendall
Posted Date:
Students also viewed these programming questions
-
QUESTION ONE: (CONTRACT LAW) Sam is a painting contractor who decides tohiresome ladders andplanksfromalocal equipment hiring business toenablehimtopainttheexteriorof a client's home.Whenhecollects...
-
Ghost Goods: How to Spot Phantom Inventory What auditors have to know to uncover phony figures. BY JOSEPH T. WELLS June 1, 2001 Journal of Accountancy ust a hint of inventory fraud can be a...
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
True or False: 1. Economists are not completely in agreement on what constitutes money for all purposes. 2. People use nontransaction accounts primarily because they generally pay higher interest...
-
What happens to a consumer's optimal choice of goods if all prices and the consumer's income double? (What happens to the intercepts of the budget constraint?)
-
Problems 5665 are based on previously learned material. The purpose of these problems is to keep the material fresh in your mind so that you are better prepared for later sections, a final exam, or...
-
Koll's Company is preparing its annual financial statements at December 31, 2020. During 2020, a customer fell while riding on the escalator and has filed a lawsuit for \(\$ 150,000\) because of a...
-
Central Station Fund. The Town of Elizabeth operates the old train station as an enterprise fund. The train station is on the national register of historic buildings. Since the town has held the...
-
Provide the missing data in the following table for a distributor of martial arts products: (Round "Turnover" and "ROI" answers to 1 decimal place.) Alpha Division Bravo Division Charlie Division...
-
The "You" Attitude Rewrite the following sentences to reflect your audience's viewpoint. 1. We request that you use the order form supplied in the back of our catalog. 2. We insist that you always...
-
Use the information below to answer the following questions. Currency per U.S. $ U.K. Pound 0.5135 6-months forward () 0.5204 Japan Yen 108.21 6-months forward () 106.96 Switzerland Franc 1.0492...
-
What theory directed at organizational improvement through understanding employee motivation and behavior?
-
Choose the correct answer below: A. Instability B. Trend C. Level shift D. Cycle Given the following control chart, which problem is most likely? X-Bar Chart of Sample Means (44 centerline crossings)...
-
The cannon on a battleship can fire a shell a maximum distance of43.9km. (a)Calculate the initial velocity of the shell in meters per second. (Enter the magnitude.) m/s (b)What maximum height in...
-
1.You are a first semester nursing student and have just received your first reading assignment for class tomorrow. You know that in order to succeed you will need to practice effective listening....
-
The drug Paregoricon is a very effective drug for pain relief and is used extensively in palliative care. In high dosages only, however, it is very effective as a performance-enhancing drug in...
-
The mean amount of life insurance per household is $117 000. This distribution is positively skewed. The standard deviation of the population is $33 000. Use Appendix B.1 for the z values. a. A...
-
Write the general quadratic equation y2 - 8y - 4x + 28 = 0 in standard form. Determine the vertex, focus, and directrix of the parabola defined by this equation. Sketch a graph.
-
Compare treating information as a resource to treating humans as a resource.
-
Describe two types of Web site designs for eliciting feedback from customers.
-
Define what is meant by doing a structured walkthrough. Who should be involved? When should structured walkthroughs be done?
-
9. INVESTIGATION Agencies have broad investigatory powers and may use subpoenas and, in some cases, warrantless searches to obtain information. (pp. 92-94)
-
1. ETHICS Suppose you were on a state supreme court and faced with a restaurant- choking case. Should you require restaurant employees to know and employ the Heimlich maneuver to assist a choking...
-
Question: When Hiller Systems, Inc., was performing a safety inspection on board the M/V Cape Diamond, an ocean-going vessel, an accident killed two men. The Occupational Safety and Health...
Study smarter with the SolutionInn App