Java

TOPIC 49 – BASICS OF STRINGS

 

LESSON WORK

 

 

QUESTION #1

 

Write a program that asks the user to enter his/her first name, then middle name, and then last name. It then outputs a Hello full name message.

 

QUESTION #2

 

Write a program that asks the user to enter his/her first name, then middle name, and then last name. The program then outputs the full initials in upper case letters. Each initial should be separated by a period and a space.

QUESTION #3

 

Write a program that asks the user for a word. Using the indexOf method (look it up), find the first occurrence of the letter “a” inside that word. Output the index of that letter to screen. What happens if the String does not contain the letter “a”?

QUESTION #4

 

Write a program that asks the user for his/her name. The program then checks if the name starts with an upper case letter. If it does, your program should simply output “Good”. If it doesn’t, your program should output “Learn to use the SHIFT key!”