Answered You can hire a professional tutor to get the answer.

QUESTION

Overview complete class that is intended to reinforce your skills in writing instance variables, accessors, and mutator methods, while also

Overview

complete class that is intended to reinforce your skills in writing instance variables, accessors, and mutator methods, while also increasing the use of if statements to provide conditional logic. You will also write tests to verify the proper operation of your code.

Your task is to develop software that monitors and controls the operation of the power sliding door of a minivan.

Requirements

The state of the door system is governed by the following operational rules:

The door can be locked or unlocked at any time, by using a lock/unlock button on the dashboard. When the door is closed, the door can only be successfully opened if: 1) the gear shift lever is in park; and 2) the door is unlocked. In such a state, any of the following mechanisms will successfully open the door: 1) an open button on the dashboard; 2) a handle on the outside of the door; or 3) a handle on the inside of the door. However, the inside handle mechanism will not open the door if a separate child-safety mechanism has been engaged, regardless of any other conditions. The child-safety mechanism can only be engaged or disengaged while the door is open. The door can be closed at any time, and the gear can be changed at any time. class that represents these features and manages the sliding door. In addition to maintaining the current state of the sliding door system, your class will also generate an event log containing a history of all attempts to change the state of the system (whether successful or not). To test your system, rather than writing an informal tester class as in the previous assignment, you will develop a comprehensive test suite using the JUnit framework, which will need to test the entirety of your implementation.

System Description

You will develop a class called MinivanDoor in the edu.vt.cs5044 package that models the behavior and state of the sliding door of the minivan. The methods of this class will be invoked by other systems, displays, and sensors within the minivan to indicate certain requests or activities. The methods of your implementation must behave according to the operational rules above. Your class will provide the following public methods, plus any private instance variables and private methods as needed:

  • Constructor:
  • MinivanDoor() initializes the minivan door system to its default state:
  • door is closed
  • door is unlocked
  • child-safety is disengaged
  • gear shift lever is in park
  • event log is empty
  • Accessors:
  • isOpen() request the state of the door
  • isLocked() request the state of the door's lock
  • isChildSafe() request the state of the child-safety feature
  • getGear() request the state of the gear shift lever
  • getLastLogEntry() request the most recent entry from the event log (returns null
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question