Plan to conquer the world

  • 6
  • Locked
"First, I'll complete the tasks, then I'm going to make a lot of money. Then I'll take over the world". We found this written in a modest young man's personal journal. Let's imagine he knows exactly when this will happen: we'll use the keyboard to enter a number (the number of years it will take to achieve his goal) and the name of the hopeful conqueror. Then we'll display an interesting phrase.
You can't complete this task, because you're not signed in.
Comments (100)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Anonymous #11180958
Level 6 , Alicante, Spain
22 November 2022, 17:36
Estaba molesto porque solo podia recibir los años como String. Por si alguien tiene el mismo problema, es porque despues de un Input Int tenemos que limpiar el buffer antes de pedir un Input String. En mi caso he escrito " lector.nextLine(); " y despues ya puedes solicitar un Input tipo String. (habria que limpiar buffer cada vez que hayamos usado un Input Int y queramos volver a pedir Input String)
Carlos Arenas
Level 26 , Highland park, Usa
19 April 2022, 01:07
I think they should not require the order in which the data is entered
W. Bus
Level 5 , Rzeszow, Poland
23 December 2021, 11:49
Ok, I'm worried now. In IDE you don't specify what the input is going to be. You don't show the output. A natural assumption is that the name will be first. Can I expect trolling like this in the future tasks? Please don't make me guess what the input is.
Daniel
Level 4 , Zagreb, Croatia
19 September 2021, 20:21
Hint: the input type must be String. Use BufferedReader.
Angel Stefan
Level 23 , Sibiu, Romania
16 September 2021, 13:42
Why is important to read first the number and the name second? Why i can't read in any order i want and only be carefful to the order in print command?
Elias Daniel Hung
Level 4 , Caracas
3 July 2021, 17:24
Kevin will take over the world in 8 years. Mwa-ha-ha! Heh heh, walk 20 km today, to get to a computer with Internet, a Pentium D, and yet it is worth it if you can laugh a while, and fight for your dreams, well done CodeGym ..!
Ice_ Beam
Level 7 , Germany
22 March 2021, 21:50
I did it with the Scanner class, it also works fine but it wouldn't let me pass. I had to use the BufferedReader one :/
Lance Wilson
Level 8 , Cincinnati
28 October 2021, 03:34
Thanks for the note! I am facing this issue now! Time to recode w/BufferedReader...ugh!
Sinisa
Level 11 , Banja Luka, Bosnia and Herzegovina
13 February 2021, 12:16
My code correctly satisfies all given requirements, yet for some reason 'The displayed text must fully match the task conditions' is marked read. The proposed solution does not comply with the requirements though, as it doesn't read data from the user input. So if I want to pass this task, I have to // the System.out.println lines.
Seth Barker
Level 5 , Eureka Springs, United States
12 January 2021, 00:15
Read the input details on the web IDE before doing the exercise in IntelliJ.
mastere
Level 9 , Rochester, United States
20 October 2020, 06:04
I actually ended up repeating this 7 times because I forgot to add a space between the number and the word years.