package com.codegym.task.task03.task0318;
/*
Plan to conquer the world
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter Age ");
String Age = reader.readLine();
System.out.println("Enter name: ");
String name = reader.readLine();
System.out.print(name + " will take over the world in " + Age + " years. Mwa-ha-ha!");
}
}
no input possible
Under discussion
Comments (5)
- Popular
- New
- Old
You must be signed in to leave a comment
Ankush Rajput
6 October 2018, 11:48
You don't have to print below lines -
0
Henrik Krogsholm
6 October 2018, 19:16
Thank you. It still does not take any input, but I got the message that the task is completed even if it does not work properly.
0
Ankush Rajput
6 October 2018, 19:21
And why do you think it does not take any input ?
This is the line that takes input -
printing enter age, enter number just prints out the specified thing and doesn't take any input. In real world, displaying messages to take input is useful but here were are simply solving questions to strengthen our concepts and not any real world usage.
Task is completed means it works properly.
Ask if you have any more doubts. 0
Henrik Krogsholm
6 October 2018, 19:37
I already know that "Enter age" only show the message. This is just information on the screen, so it looks more nice, but I am not able to make input from my keyboard to be printed out. i mean that this should be the product of the code, that I could type a name and a age and then see it in the sentence..
0
Ankush Rajput
6 October 2018, 19:47
You can see it in "Run" section next to verify one. Put your inputs in the text box, each on a new line. It will display the output.
0