Advertisement
Guest User

Untitled

a guest
Nov 15th, 2017
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.23 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class readMethodScanner {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int n = Integer.parseInt(scanner.nextLine());
  7.         String read = "";
  8.         String operation = "";
  9.         String message = "";
  10.         String errorCode = "";
  11.         String read5 = "";
  12.         int count = 0;
  13.  
  14.  
  15.         while (count <= n) {
  16.             read = scanner.nextLine();
  17.             if (read.equals("error")) {
  18.                 read = scanner.nextLine();
  19.                 operation = read;
  20.                 read = scanner.nextLine();
  21.                 message = read;
  22.                 read = scanner.nextLine();
  23.                 errorCode = read;
  24.             } else if (read.equals("warning")) {
  25.                 read = scanner.nextLine();
  26.                 operation = read;
  27.             } else if (read.equals("success")) {
  28.                 read = scanner.nextLine();
  29.                 operation = read;
  30.                 read = scanner.nextLine();
  31.                 message = read;
  32.             }else if (read.equals("warning")) {
  33.                 read = scanner.nextLine();
  34.                 operation = read;
  35.             }
  36.  
  37.             count++;
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement