Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Task6
- {
- public static void main(String[] args)
- {
- Scanner scanner = new Scanner(System.in);
- String question = scanner.nextLine();
- boolean upperCase = question.equals(question.toUpperCase());
- while (true) {
- if (question.endsWith("?")) {
- if (upperCase) {
- System.out.println("Спокоооо, знам к'во правя!");
- }
- else {
- System.out.println("Добре.");
- }
- }
- else if (upperCase) {
- System.out.println("Споко бе, ман!");
- }
- else if (question.isEmpty()) {
- System.out.println("Хубаво деее");
- }
- else {
- System.out.println("Ахъ");
- }
- question = scanner.nextLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment