import javax.swing.JOptionPane;
import org.opentutorials.iot.DimmingLights;
import org.opentutorials.iot.Elevator;
import org.opentutorials.iot.Lighting;
import org.opentutorials.iot.Security;
public class OkJavaGoInHomeInput {
public static void main(String[] args) {
String id = JOptionPane.showInputDialog("Enter a ID");
String bright = JOptionPane.showInputDialog("Enter a Bright level");
// Elevator call
Elevator myElevator = new Elevator(id);
myElevator.callForUp(1);
// Security off
Security mySecurity = new Security(id);
mySecurity.off();
// Light on
Lighting hallLamp = new Lighting(id+" / Hall Lamp");
hallLamp.on();
Lighting floorLamp = new Lighting(id+" / floorLamp");
floorLamp.on();
DimmingLights moodLamp = new DimmingLights(id+" moodLamp");
moodLamp.setBright(Double.parseDouble(bright));
moodLamp.on();
}
}
'JAVA > 생활코딩 JAVA 입문 수업' 카테고리의 다른 글
JAVA1 - 12.1. 직접 컴파일하고 실행하기 : 소개 (0) | 2023.03.28 |
---|---|
JAVA1 - 11.2. 입력과 출력 : arguments & parameter (0) | 2023.03.21 |
JAVA1 - 10. 디버거 (0) | 2023.03.21 |
JAVA1 - 9.3. IOT 프로그램 만들기 (0) | 2023.03.14 |
JAVA1 - 9.2. 프로그램 만들기 - IoT 라이브러리 설치하기 (0) | 2023.03.14 |
import javax.swing.JOptionPane;
import org.opentutorials.iot.DimmingLights;
import org.opentutorials.iot.Elevator;
import org.opentutorials.iot.Lighting;
import org.opentutorials.iot.Security;
public class OkJavaGoInHomeInput {
public static void main(String[] args) {
String id = JOptionPane.showInputDialog("Enter a ID");
String bright = JOptionPane.showInputDialog("Enter a Bright level");
// Elevator call
Elevator myElevator = new Elevator(id);
myElevator.callForUp(1);
// Security off
Security mySecurity = new Security(id);
mySecurity.off();
// Light on
Lighting hallLamp = new Lighting(id+" / Hall Lamp");
hallLamp.on();
Lighting floorLamp = new Lighting(id+" / floorLamp");
floorLamp.on();
DimmingLights moodLamp = new DimmingLights(id+" moodLamp");
moodLamp.setBright(Double.parseDouble(bright));
moodLamp.on();
}
}
'JAVA > 생활코딩 JAVA 입문 수업' 카테고리의 다른 글
JAVA1 - 12.1. 직접 컴파일하고 실행하기 : 소개 (0) | 2023.03.28 |
---|---|
JAVA1 - 11.2. 입력과 출력 : arguments & parameter (0) | 2023.03.21 |
JAVA1 - 10. 디버거 (0) | 2023.03.21 |
JAVA1 - 9.3. IOT 프로그램 만들기 (0) | 2023.03.14 |
JAVA1 - 9.2. 프로그램 만들기 - IoT 라이브러리 설치하기 (0) | 2023.03.14 |