"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.
Plan to conquer the world
- 6
Locked
Comments (100)
- Popular
- New
- Old
You must be signed in to leave a comment
Anonymous #11180958
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)
0
Carlos Arenas
19 April 2022, 01:07
I think they should not require the order in which the data is entered
+1
W. Bus
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.
0
Daniel
19 September 2021, 20:21
Hint: the input type must be String. Use BufferedReader.
0
Angel Stefan
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?
+1
Elias Daniel Hung
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 ..!
0
Ice_ Beam
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 :/
+1
Lance Wilson
28 October 2021, 03:34
Thanks for the note! I am facing this issue now! Time to recode w/BufferedReader...ugh!
0
Sinisa
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.
0
Seth Barker
12 January 2021, 00:15
Read the input details on the web IDE before doing the exercise in IntelliJ.
0
mastere
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.
0