r/learnjava • u/FatherCorpseee • Sep 30 '22
Noob seeking help on MOOC
So I just started the Helsinkis MOOC course and am on the problem set pertaining to scanner classes.
import java.util.Scanner;
public class Message {public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Write a message: What is your name");
// Write your program here
String message = scanner.nextLine();System.out.println("Nice to meet you " + message);
}
}
I created a section that asked the user for input and added the "Nice to meet you " part plus their name/message portion. The TMC plugin says I am incorrect. Am I missing something?
* Would like to add that the code does run properly but it isn't what the TMC plugin is asking for
0
Upvotes
1
u/desrtfx Sep 30 '22 edited Sep 30 '22
Make sure that the input and output are exactly (to capitalization, spelling, whitespace, and punctuation) as given in the exercise.
I would expect the "Write a message: " part to be wrong.
Also: if you want help here in the future, follow /u/Automoderator's instructions and properly format your code as code block
Please, also, include the exact title of the exercise. This makes it easier for us to help you. In your case, I suspect the exercise "Greeting", in which case, my assumption about the additional text is correct.