How to take over the world

  • 2
  • Locked
Enter a name and number from the keyboard, and then display the line: «name» will take over the world in «number» years. Mwa-ha-ha! Example: Kevin will take over the world in 8 years. Mwa-ha-ha! The order in which the data is input matters a lot.
You can't complete this task, because you're not signed in.
Comments (8)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Ron Knapper
Level 3 , United States of America, United States
7 April, 14:34
Might be a scope issue (shouldn't it all be in main?), but I copied and pasted the code from the previous page and still get an error. I still don't understand, but copied the code from the previous page. It's the code they give you... shouldn't it work?
Level 41
13 April, 06:16
Please post your question with the attached solution in the section Help.
Corly Boy
Level 4 , Bucharest, Romania
19 March, 10:40
How did you solve it? Looks like I don't understand what he's asking me to do!
Level 41
28 March, 06:35
Surprisingly, your solution was successfully tested on my PC. if there is still a problem, write me a personal message.
5 January, 00:36
where did reader.readLine(); come from?
5 January, 00:35
I am not certain how all these things come into play: BufferedReader reader = new BufferedReader(new InputStreamReader(; String name = reader.readLine(); String years = reader.readLine(); Can someone help to explain further?
Level 6 , United States
23 November 2021, 02:02
I believe you could, though you would have to import the package of course.
Level 6 , India, India
1 November 2021, 14:28
can scanner class is used