Question: Question 1 120 pts) Write a simple class called Maintenance Java with the following variables and constructor Variables: year is the year of the maintenance.

 Question 1 120 pts) Write a simple class called Maintenance Java
with the following variables and constructor Variables: year is the year of
the maintenance. examiner is the person who took care of the maintenance
Constructor: Write a constructor which: Gets a year and an examiner as

Question 1 120 pts) Write a simple class called Maintenance Java with the following variables and constructor Variables: year is the year of the maintenance. examiner is the person who took care of the maintenance Constructor: Write a constructor which: Gets a year and an examiner as parameter Initializes the year and the examiner Eg. public Maintenance(int y, String e) year = y; examiner-e:) . . Question 2(40 pts Write a class called temjava with the following variables, methods and the constructor Variables: . code is the code of the item yearSold is the year in which the item is sold* customer is the name of the person who bought the item nrOfMt is the number of maintenance the item had mt is the array of maintenance objects initialized with 0 length, e.g. Maintenance D mt- new.... .Gets the code, year sold and customer name as parameter Constructor: Write a constructor which: Initializes the corresponding variables as it also initializes the nromt to o. Methods: equals gets a single ltem object as parameter, e.g. public boolean equals(tem 00. Returns true it the code of both objects are the same, returns false otherwise. addMaintenance gets year and examiner as parameter and returns nothing. This method: creates a new Maintenance object using its constructor by giving the year and examiner as o parameters. increments the size of the mt array by one first, and add the new maintenance at the end of the array. o increments the nrOfMt by one stilGuaranteed gets a year as parameter. This method returns false if number of total maintenances s larger than four or the duration in between the given year and the year sold is larger than two years. Otherwise, the method returns true. print gets no parameter and returns nothing. This method prints: the year sold and the customer in all uppercases o number of maintenance o dates and examiners of all maintenances whether the item is still guaranteed or not (use year 2017 as parameter while calling stillGuaranteed method) PLEASE SEE THE SAMPLE OUTPUT. 'Please be careful that the year of maintenance, the year sold and the code variables should be declared as integer in above classes

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!