Advertisement
Guest User

Test Program

a guest
Jan 27th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class PoliceDatabase {
  4. String age;
  5. String name;
  6. String prescriptions;
  7. String address;
  8. String DOB;
  9. String all;
  10. String history;
  11. }
  12. public class ForTestsOnly {
  13. public static void main(String[] args) {
  14. Scanner userinput = new Scanner(System.in);
  15.  
  16. PoliceDatabase Drunkdriver = new PoliceDatabase();
  17. Drunkdriver.age = "Age: 20\n";
  18. Drunkdriver.name = "Name: Joe Dirt\n";
  19. Drunkdriver.prescriptions = "Prescriptions: None \n";
  20. Drunkdriver.address = "Address: 7428 Venido Road \n";
  21. Drunkdriver.DOB = "Date of Birth: March 14, 1998 \n";
  22. Drunkdriver.history = "On Record: DUI and Assaulting a Police Officer";
  23. Drunkdriver.all = Drunkdriver.age + Drunkdriver.name + Drunkdriver.prescriptions + Drunkdriver.address + Drunkdriver.DOB + Drunkdriver.history;
  24.  
  25. String nextLine = userinput.nextLine();
  26.  
  27. System.out.println("As you're doing a routine circle around a neighbourhood, you see someone swerving.");
  28.  
  29. System.out.println("You pull up behind them and do the siren wail thing cops do but dont really have a name for.");
  30.  
  31. System.out.println("You walk up to the driver window and you can smell the distinct alcohol smell.");
  32.  
  33. System.out.println("As he is about to say 'I can explain' you cut him off and say 'Give me your ID!'");
  34.  
  35. System.out.println("He hands you his ID and you say 'Turn off the car and give me the keys.'");
  36.  
  37. System.out.println("He does so, and you walk back to your car and open the database.");
  38.  
  39. System.out.println("Joe Dirt");
  40.  
  41. System.out.println("-----POLICE DATABASE-----");
  42.  
  43. System.out.println(" ");
  44.  
  45. System.out.println(Drunkdriver.all);
  46.  
  47. System.out.println(" ");
  48.  
  49. System.out.println("-----POLICE DATABASE-----");
  50.  
  51. System.out.println("As you're getting out of your car, you wonder\nif what he did to the last officer could happen to you.");
  52.  
  53. System.out.println("You're thinking whether you should let him off the hook or not.");
  54.  
  55. System.out.println("-----");
  56.  
  57. System.out.println(".offthehook = let him off the hook");
  58.  
  59. System.out.println(".arresthim = bring him to jail");
  60.  
  61. System.out.println("-----");
  62.  
  63. switch (nextLine) {
  64. case ".offthehook":
  65. System.out.println("You walk to his car and say 'you're off the hook, kid.'");
  66. System.out.println("You walk back to your car feeling guilty for letting him off the hook.");
  67. System.out.println("You continue with your day as normal.");
  68. break;
  69. case ".arresthim":
  70. System.out.println("You walk to his car and say 'sir, get out of the car.'");
  71. System.out.println("He gets out of the car.");
  72. System.out.println("While he's opening the door, he tries to charge at you, \nbut you step to the side and trip him.");
  73. System.out.println("You pin him to the ground and handcuff him.");
  74. System.out.println("-----10 minutes later-----");
  75. System.out.println("As you're driving to the station, you wonder why he did that.");
  76. break;
  77. }
  78. userinput.close();
  79. }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement