Question: 2 . Conditional GreetingObjective: Learn to obtain user input and use conditional statements.Instructions:Ask the user for their name using the Scanner class.Implement a conditional statement
Conditional GreetingObjective: Learn to obtain user input and use conditional statements.Instructions:Ask the user for their name using the Scanner class.Implement a conditional statement to check the name entered:If the name is "Alice" or "Bob", greet the user with "Hello, Alice!" or "Hello, Bob!" respectively.For all other names, greet the user with "Hello, Name
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
