Advertisement
Guest User

Main.java

a guest
Feb 20th, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.18 KB | None | 0 0
  1. // SPENCER CODY CHIRMAN
  2. // DISCUSSION 6
  3. // FEBRUARY 20, 2020
  4. // CMIS 141 INTRODUCTORY PROGRAMMING
  5. // UNIVERSITY OF MARYLAND GLOBAL CAMPUS
  6.  
  7. // MAIN CLASS
  8.  
  9. import java.util.Scanner;
  10.  
  11. public class Main
  12. {
  13.   static Scanner input;
  14.   static SecurityCamera camera1;
  15.  
  16.   public static void main(String[] args) {
  17.     input = new Scanner(System.in);
  18.     String name = new String();
  19.     System.out.println("SECURITY CAMERA PROGRAM");
  20.     System.out.print("name your camera: ");
  21.     name = input.nextLine();
  22.     SecurityCamera camera1 = new SecurityCamera(name);
  23.     System.out.println("camera " + name + " created");
  24.     boolean b = true;
  25.     while(b == true) {
  26.       System.out.println("\nPROMPT: type \"start\" or \"stop\" to begin or end recording, type \"end\" to terminate program");
  27.       String action = input.next();
  28.       if(action.equals("start")) {
  29.         camera1.startRecording();
  30.       } else if (action.equals("stop")) {
  31.         camera1.stopRecording();
  32.       } else if (action.equals("end")) {
  33.         b = false;
  34.         System.out.println("TERMINATING PROGRAM...");
  35.       } else {
  36.         System.out.println("ERROR: command not recognized.");
  37.       }
  38.     }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement