Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SPENCER CODY CHIRMAN
- // DISCUSSION 6
- // FEBRUARY 20, 2020
- // CMIS 141 INTRODUCTORY PROGRAMMING
- // UNIVERSITY OF MARYLAND GLOBAL CAMPUS
- // SECURITY CAMERA CLASS
- public class SecurityCamera
- {
- private boolean isRecording;
- public String cameraName;
- public SecurityCamera() {
- isRecording = false;
- cameraName = "unnamed camera";
- }
- public SecurityCamera(String name) {
- isRecording = false;
- cameraName = name;
- }
- public void startRecording() {
- if(isRecording) {
- System.out.println("ERROR: " + cameraName + " already recording");
- return;
- }
- isRecording = true;
- System.out.println(cameraName + " set to record");
- }
- public void stopRecording() {
- if(isRecording == false) {
- System.out.println("ERROR: " + cameraName + " was not recording");
- return;
- }
- isRecording = false;
- System.out.println(cameraName + " is no longer recording");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement