Gives the error: The displayed text does not correspond to the task conditions. But if you try, the answer is correct! Can someone help me?
package com.codegym.task.task03.task0319;
/*
Predictions
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String name, number1, number2;
System.out.print("Name: ");
name = reader.readLine();
System.out.print("Number 1: ");
number1 = reader.readLine();
System.out.print("Number 2: ");
number2 = reader.readLine();
System.out.println(name + " will receive " + number1 + " in " + number2 + " years.");
}
}
package com.codegym.task.task03.task0319;
/*
Predictions
1. The program should output text.
2. The program must read data from the keyboard.
3. The displayed text must contain the entered name.
4. The displayed text must contain the entered number1.
5. The displayed text must contain the entered number2.
6. The displayed text must fully match the task conditions.
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String name;
int number1, number2;
System.out.print("Name: ");
name = reader.readLine();
System.out.print("Number 1: ");
number1 = Integer.parseInt(reader.readLine());
System.out.print("Number 2: ");
number2 = Integer.parseInt(reader.readLine());
System.out.println(name + " will receive " + number1 + " in " + number2 + " years.");
}
}