Java代写 | OOP代写 – java assignment

Java代写 | OOP代写: 这是一个java面向对象代写
Q2:
Define a home security system class that has three fields,
1. isDoorOpen: a Boolean to indicate whether the door is opened or not,
2. isArmed: a Boolean to indicate the state whether the system is turned on:
3. onDuration: a float or integer to indicate how long the system is to be turned on:
the value for the field can’t be negative, here, the minimal of the value is 0 (which means 0 day), 0.1 means 0.1 days to be turned on.

Q2.1. Constructor:
define several different constructors, at least should have the following 3 constructors:
a default constructor without any parameter,
a constructor has one parameter with the initial state of the system as a parameter
a constructor with multiple parameters for the above variables.
4. or other constructor you think reasonable
Q2.2. The class should have following methods:
1. a method to arm or disarm the whole system,
2. a method to check the current status of the door,
3. a method to set how long the system will be turned on
4. a method to return how long the system has been turned on.

Q2.3. if there is any variable missing, just add reasonable variables,

Q2.4. Also, write a main() function which can be used to test all the method.

Submission:
Submit to me as .zip file such as submit 88188.zip file to me.
inside it:
a. the zip file will include .java source file, as well as
b. a readme to include instructions about how to run/test the code;
c. a .log file to include the result of the code.

发表评论

电子邮件地址不会被公开。 必填项已用*标注