package com.codegym.task.task03.task0319;
/*
Predictions
Use the keyboard to separately enter the name, number1, and number2.
Display the following phrase:
<name> will receive <number1> in <number2> years.
Here's an example:
Nick will receive 10000 in 5 years.
Nick will receive 10000 in 5 years.
Requirements:
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.*;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
//write your code here
Scanner myName = new Scanner(System.in);
System.out.println("Print Name");
String userName = myName.nextLine();
Scanner num1 = new Scanner(System.in);
System.out.println("how much");
String amount = num1.nextLine();
Scanner num2 = new Scanner(System.in);
System.out.println("number of years");
String amtYears = num2.nextLine();
System.out.println(userName + " will receive " + amount + " in " + amtYears + " years.");
}
}
package com.codegym.task.task03.task0319;
/*
Predictions
Use the keyboard to separately enter the name, number1, and number2.
Display the following phrase:
<name> will receive <number1> in <number2> years.
Here's an example:
Nick will receive 10000 in 5 years.
Nick will receive 10000 in 5 years.
Requirements:
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.*;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
//write your code here
Scanner myName = new Scanner(System.in);
System.out.println("Print Name");
String userName = myName.nextLine();
Scanner num1 = new Scanner(System.in);
System.out.println("how much");
String amount = num1.nextLine();
Scanner num2 = new Scanner(System.in);
System.out.println("number of years");
String amtYears = num2.nextLine();
System.out.println(userName + " will receive " + amount + " in " + amtYears + " years.");
}
}