This is my code
/*
Plan to conquer the world
*/
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws Exception {
int number;
String name;
Scanner console = new Scanner(System.in);
System.out.print("Enter number: ");
number = console.nextInt();
console.nextLine();
System.out.print("Enter name: ");
name = console.nextLine();
System.out.println(name + " will take over the world in "+ number + " years. Mwa-ha-ha!");
}
}
The code runs and displays exactly what was required. Can you tell me what I am missing?
package com.codegym.task.task03.task0318;
/*
Plan to conquer the world
*/
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws Exception {
int number;
String name;
Scanner console = new Scanner(System.in);
System.out.print("Enter number: ");
number = console.nextInt();
console.nextLine();
System.out.print("Enter name: ");
name = console.nextLine();
System.out.println(name + " will take over the world in "+ number + " years. Mwa-ha-ha!");
}
}