subject
Engineering, 24.03.2020 06:07 Jimenezmiranda

You will create three classes, the first two being Student and LineAtOfficeHour. The instances of the first class defines a single student while an instance of the second class defines a line of students waiting to see an instructor in their office hour. The Student class should have the following: • Private instance variables to store the first and last name of the student. • A constructor that sets all of the instance variables. You do not need to write a no-arg constructor in addition to the constructor that sets all of the instance variables. • Public methods to get and set the instance variables and a method fullName() that returns the full name of the student (first then last) as a String (i. e., does not print it out to the screen). The LineAtOfficeHour class holds Student objects in a line and has methods to manipulate this line. • Private instance variables: o an array of Students called line. o an integer N representing the number of students in the line. o an integer back representing the index of the last student in line. • Constructors: o no-argument constructor which sets the length of the line to 5, however the line should start off empty. • a constructor that takes an array of Student objects as argument and fills the line variable with up to 5 Students (but can also take as input an array of fewer than 5 Student objects). If the given input argument array has more than 5 Students, then you should populate the line with the first 5 Students out of the input array. • Public methods: • a method called isEmpty which returns true if the line is empty. o a method called isFull which returns true if the line is full. o a method called size which returns the number of students waiting in line. o a method called enterLine which takes a Student object as the argument and puts it at the back of the line (i. e. behind the last student currently in line). This method does not need to return anything. Note: if the line is full, the Student should not be placed in the line and should be rejected with an appropriate message. o a method called see Teacher which removes the Student object from the front of the line (i. e. the student who is currently first in line gets to see the teacher when this method is called) and returns the Student object. Note: the remaining students should move toward the front of the line as result of this method being called. o a method called whoslnLine which returns a list (as a String) of all the names of the Students in the line, in the order they are in line (the first student first, a comma, the second name, and so on). Finally, write a driver class TestLine that will create a LineAtOfficeHour object, fill it with Student objects, and test that the methods of LineAtOfficeHour function correctly.

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 08:10
Which of the following is an easy way to remember the modified “x” tire rotation? a. nondrive wheels straight, cross the drive wheels b. drive wheels straight, cross the nondrive wheels c. drive wheels crossed, nondrive wheels straight d. drive wheels crossed, nondrive wheels crossed
Answers: 1
question
Engineering, 04.07.2019 18:20
Athin walled concentric tube exchanger is used to cool engine oil from 160°c to 60°c with water that is available at 25°c acting as a coolant. the oil and water flow rates are each at 2 kg/s, and the diameter of the inner tube is 0.5 m and the corresponding value of the overall heat transfer coefficient is 250 w/m2. oc. how long must the heat exchanger be to accomplish the desired cooling? cpwater=4.187 kj/kg-candcpengine el=2.035 kj/kg·°c, oil . 120]
Answers: 1
question
Engineering, 04.07.2019 18:20
Modern high speed trains do not have perpendicular expansion gaps where rails are joined end-to-end any more they are mostly welded together but what might happen if there was a spell of particularly hot weather that causes inspection of the tracks?
Answers: 1
question
Engineering, 04.07.2019 18:20
An open feedwater heater operates at steady state with liquid entering at inlet 1 with t? = 40°c and pl = 1 .2 mpa. water vapor att2-200°c and p2 = 1.2 mpa enters at inlet 2. saturated liquid water exits with a pressure of pa 1.2 mpa. neglect heat transfer with the surroundings and all kinetic and potential energy effects, determine the mass flow rate of steam at inlet 2 if the mass flow rate of liquid water at inlet 1 is given as 2 kg/s.
Answers: 3
You know the right answer?
You will create three classes, the first two being Student and LineAtOfficeHour. The instances of th...
Questions
question
Arts, 26.02.2021 02:00
question
Mathematics, 26.02.2021 02:00
question
Mathematics, 26.02.2021 02:00
Questions on the website: 13722367