The text seems fine to me. Can someone tell me what is wrong?
package com.codegym.task.task03.task0318;
/*
Plan to conquer the world
Enter the number and name from the keyboard. Display the following string:
<name> will take over the world in <number> years. Mwa-ha-ha!
Kathy will take over the world in 9 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:
1. The program should output text.
2. The program must read data from the keyboard.
3. The displayed text must contain the entered name.
4. The displayed text must contain the entered number.
5. The displayed text must fully match the task conditions.
*/
import java.io.*;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
Scanner myName = new Scanner(System.in); // Create a Scanner object
System.out.println("Enter username");
String userName = myName.nextLine(); // Read user input
Scanner worldYears = new Scanner(System.in); // Create a Scanner object
System.out.println("Enter years");
String numYears = worldYears.nextLine(); // Read user input
System.out.println(userName + " will take over the world in " + numYears + " years. Mwa-ha-ha!");
}
}