Question: JAVA -Write a Java console application that prompts the user to enter the first name and last name, then prints the welcome message. The Console
JAVA
-Write a Java console application that prompts the user to enter the first name and last name, then prints the welcome message.
The Console Output
Please enter your first name: Jerry Please enter your last name: Zhou Hello, Jerry Zhou, Welcome to CIS 226.
- Write comments at the beginning of the file per class coding conventions
- Print the message using + for String concatenation, and " " for new line.
Enhance your program to print error message if user doesn't enter first and/or last name.
Please enter your first name: Please enter your last name: Sorry, you have to enter your name to enroll into CIS 226.
- Use String method isEmpty() to check if user didn't type any characters.
- User if/else statement to decide print welcome message or error message.
- Use logical operator || or && to combine two conditions into one.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
