Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here are the text part. Assume that the classes listed in the Java Quick Reference have been imported where appropriate Unless otherwise noted in the

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Here are the text part.
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Assume that the classes listed in the Java Quick Reference have been imported where appropriate Unless otherwise noted in the question, assume that parameters in method calls are not null and that methods are called only when their preconditions are satisfied in writing solutions for each question, you may use any of the accessible methods that are listed in classes defined in that question Writing significant amounts of code that can be replaced by a call to one of these methods will not receive full credit This question involves the scheduling of car repairs. The classes used in the question are used to record information about car repairs. The methods shown and the methods to be weiten involve the mechanic performing a repair and the boy in which the repair takes place. A bay is an area of a repair shop in which a car is parked while a mechanic performs a repair, Mechanics and boys we Identified by sequential integer identification numbers that start with An individual car repair in represented by the following cartepair class public class Carlepair private int mechanicum private int bayan publie Carlepair (int n, int b) mechanics baynus - bi public class CarRepair { private int mechanicNum; private int bayNum; public Car Repair(int m, int b) mechanicNum = m; bayNum = b; } public int getMechanieNum() { return mechanicNum;) public int getBayNum) { return bayNum;) // There may be other instance variables, constructors, and methods not shown. The following Repairschedule class represents the use of bays by mechanics repairing cars. You will write two methods of the RepairSchedule class public class RepairSchedule 7** Each element represents a repair by an individual mechanic in a bay. */ private ArrayList 0 public Repairschedule(int n) schedule - new ArrayList 0 ./ publie boolean addRepair(int n, int b) 1 to be implemented in part (a) / ** Returns an array.it containing the mechanic identifiers of all availablo mechanics, public ArrayList 0 public boolean addrepairint mint b) E 0 / 10000 Word Limit (b) Write the availableNechanice method, which returns an ArrayList containing the mechanic numbers of all available mechanics if there is no avalable mechanic, an emptylitis returned. A mechanic is available if the mechanic identifier does not appear is schedule Suppose schedule has the following contents 0 1 mechanicNum bayNum 1 4 0 1 mechanicNum bayNum 1 4 For these contents of schedule, available chante should return an arrayList containing the values 2,3,4, and 5 (in any order). Complete the availableMechanics method. Assume that adarapate works as specified, regardless of what you wrote in part() /** Returns an ArrayList containing the nechanic identifiers of all available mechanics, as described in part (b). */ public ArrayList public int getMechanichun() (return mechanichun;) public int getsayun) { return bayfium;) 1/ There may be other instance variables, constructors, and methods not shown. The following RepairSchedule dass represents the use of bays by mechanics repairing cars. You will write two methods of the RepairSchedule class public class Repairschedule * Each element represents a repair by an Individual mechanic in a bay." private ArrayList 0 public RepairSchedule(int n) " schedule = new ArrayList(); number of mechanics - 1 * Attempts to schedule a repair by a given mechanic in a given bay as described in part (a). Precondition: e- public boolean addRepair(int n, int b) to be implemented in part (1) */ /** Returns an ArrayList containing the mechanic Identifiers of all available mechanics, as described in part (b). public ArrayList= 0 ./ public boolean addRepair(int m, int b) B 1 III (b) Write the availableMechanics method, which returns an ArrayList containing the mechanic numbers of all available mechanic mechanic is available if the mechanic's identifier does not appear in schedule. Suppose schedule has the following contents. maahaniam art B: Write the availableMechanics method, which returns an ArrayList containing the mechanic numbers of all available mechanics. If there is no available mechanic, an empty list is returned. A mechanic is available if the mechanic's identifier does not appear in schedule. Suppose schedule has the following contents. 0 1 mechanicNum bayNum 1 4 For these contents of schedule, available Mechanic should return an ArrayList containing the values 2, 3, 4, and 5 (in any order). Complete the available Mechanics method. Assume that addRepair works as specified, regardless of what you wrote in part (a). /** Returns an ArrayList containing the mechanic identifiers of all available mechanics, as described in part (b). */ public ArrayList availableMechanics Assume that the classes listed in the Java Quick Reference have been imported where appropriate Unless otherwise noted in the question, assume that parameters in method calls are not null and that methods are called only when their preconditions are satisfied in writing solutions for each question, you may use any of the accessible methods that are listed in classes defined in that question Writing significant amounts of code that can be replaced by a call to one of these methods will not receive full credit This question involves the scheduling of car repairs. The classes used in the question are used to record information about car repairs. The methods shown and the methods to be weiten involve the mechanic performing a repair and the boy in which the repair takes place. A bay is an area of a repair shop in which a car is parked while a mechanic performs a repair, Mechanics and boys we Identified by sequential integer identification numbers that start with An individual car repair in represented by the following cartepair class public class Carlepair private int mechanicum private int bayan publie Carlepair (int n, int b) mechanics baynus - bi public class CarRepair { private int mechanicNum; private int bayNum; public Car Repair(int m, int b) mechanicNum = m; bayNum = b; } public int getMechanieNum() { return mechanicNum;) public int getBayNum) { return bayNum;) // There may be other instance variables, constructors, and methods not shown. The following Repairschedule class represents the use of bays by mechanics repairing cars. You will write two methods of the RepairSchedule class public class RepairSchedule 7** Each element represents a repair by an individual mechanic in a bay. */ private ArrayList 0 public Repairschedule(int n) schedule - new ArrayList 0 ./ publie boolean addRepair(int n, int b) 1 to be implemented in part (a) / ** Returns an array.it containing the mechanic identifiers of all availablo mechanics, public ArrayList 0 public boolean addrepairint mint b) E 0 / 10000 Word Limit (b) Write the availableNechanice method, which returns an ArrayList containing the mechanic numbers of all available mechanics if there is no avalable mechanic, an emptylitis returned. A mechanic is available if the mechanic identifier does not appear is schedule Suppose schedule has the following contents 0 1 mechanicNum bayNum 1 4 0 1 mechanicNum bayNum 1 4 For these contents of schedule, available chante should return an arrayList containing the values 2,3,4, and 5 (in any order). Complete the availableMechanics method. Assume that adarapate works as specified, regardless of what you wrote in part() /** Returns an ArrayList containing the nechanic identifiers of all available mechanics, as described in part (b). */ public ArrayList public int getMechanichun() (return mechanichun;) public int getsayun) { return bayfium;) 1/ There may be other instance variables, constructors, and methods not shown. The following RepairSchedule dass represents the use of bays by mechanics repairing cars. You will write two methods of the RepairSchedule class public class Repairschedule * Each element represents a repair by an Individual mechanic in a bay." private ArrayList 0 public RepairSchedule(int n) " schedule = new ArrayList(); number of mechanics - 1 * Attempts to schedule a repair by a given mechanic in a given bay as described in part (a). Precondition: e- public boolean addRepair(int n, int b) to be implemented in part (1) */ /** Returns an ArrayList containing the mechanic Identifiers of all available mechanics, as described in part (b). public ArrayList= 0 ./ public boolean addRepair(int m, int b) B 1 III (b) Write the availableMechanics method, which returns an ArrayList containing the mechanic numbers of all available mechanic mechanic is available if the mechanic's identifier does not appear in schedule. Suppose schedule has the following contents. maahaniam art B: Write the availableMechanics method, which returns an ArrayList containing the mechanic numbers of all available mechanics. If there is no available mechanic, an empty list is returned. A mechanic is available if the mechanic's identifier does not appear in schedule. Suppose schedule has the following contents. 0 1 mechanicNum bayNum 1 4 For these contents of schedule, available Mechanic should return an ArrayList containing the values 2, 3, 4, and 5 (in any order). Complete the available Mechanics method. Assume that addRepair works as specified, regardless of what you wrote in part (a). /** Returns an ArrayList containing the mechanic identifiers of all available mechanics, as described in part (b). */ public ArrayList availableMechanics

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago