jwrbg

Task6

Feb 20th, 2020
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Task6
  6. {
  7. public static void main(String[] args)
  8. {
  9. Scanner scanner = new Scanner(System.in);
  10. String question = scanner.nextLine();
  11. boolean upperCase = question.equals(question.toUpperCase());
  12.  
  13. while (true) {
  14.  
  15. if (question.endsWith("?")) {
  16. if (upperCase) {
  17. System.out.println("Спокоооо, знам к'во правя!");
  18. }
  19. else {
  20. System.out.println("Добре.");
  21. }
  22. }
  23. else if (upperCase) {
  24. System.out.println("Споко бе, ман!");
  25. }
  26. else if (question.isEmpty()) {
  27. System.out.println("Хубаво деее");
  28.  
  29. }
  30. else {
  31. System.out.println("Ахъ");
  32. }
  33.  
  34. question = scanner.nextLine();
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment