CodeGym
Promotion
CodeGym University
Learning
Courses
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme
Question
  • Reviews
  • About us
Start
Start learning
Start learning now
  • All questions
CodeGym/Help with Java Tasks/I don't see what I'm typing wrong
Nicholas Corten
Level 4
Antwerp
  • 04.11.2020
  • 829views
  • 3comments

I don't see what I'm typing wrong

Question about the task Plan to conquer the world
Java Syntax,  Level 3,  Lesson 8
Resolved

Enter the number and name from the keyboard. Display the following string:
<name> will take over the world in <number> years. Mwa-ha-ha!

Here's an example:
Kevin will take over the world in 8 years. Mwa-ha-ha!

The order in which the data is input matters a lot.

Requirements:
  • The program should output text.
  • The program must read data from the keyboard.
  • The displayed text must contain the entered name.
  • The displayed text must contain the entered number.
  • The displayed text must fully match the task conditions.
package com.codegym.task.task03.task0318; /* Plan to conquer the world */ import java.io.*; import java.util.Scanner; public class Solution { public static void main(String[] args) throws Exception { Scanner scan = new Scanner(System.in); String name = scan.nextLine(); int number = scan.nextInt(); System.out.println(name + " will take over the world in " + number + " years. Mwa-ha-ha!"); } }
0
Comments (3)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
sergio
Level 7 , Colorado, United States
10 November 2020, 22:51
/* Comment has been deleted */
0
Misiu
Level 41 , Gdansk, Poland
10 November 2020, 23:11
There is one line to display. The frame of the example can't fit all string so shows it as two lines.
0
Misiu
Level 41 , Gdansk, Poland
4 November 2020, 19:39useful
"Enter the number and name" - order of entering data.
+2
Learn
  • Registration
  • Java Course
  • Help with Tasks
  • Pricing
  • Java Syntax
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success Stories
  • Activity
  • Affiliate Program
Company
  • About us
  • Contacts
  • Reviews
  • Press Room
  • CodeGym for EDU
  • FAQ
  • Support
CodeGym CodeGym is an online course for learning Java programming from scratch. This course is a perfect way to master Java for beginners. It contains 1200+ tasks with instant verification and an essential scope of Java fundamentals theory. To help you succeed in education, we’ve implemented a set of motivational features: quizzes, coding projects, content about efficient learning, and a Java developer’s career.
Follow us
Interface language
English
Deutsch Español हिन्दी Français Português Polski বাংলা 简体中文 मराठी தமிழ் Italiano Bahasa Indonesia 繁體中文 Nederlands 日本語 한국어 Bulgarian Danish Hungarian Basa Jawa Malay Norwegian Romanian Swedish Telugu Thai Українська Filipino Turkish Azərbaycan Русский Vietnamese
Programmers Are Made, Not Born © 2025 CodeGym
MastercardVisa
Programmers Are Made, Not Born © 2025 CodeGym