Question: Please make sure the program works properly first. S . BE Question 2 Manipulating variables of type String (6 points) Write a program which 1.

 Please make sure the program works properly first. S . BE

Question 2 Manipulating variables of type String (6 points) Write a program

Please make sure the program works properly first.

S . BE Question 2 Manipulating variables of type String (6 points) Write a program which 1. Display a welcome message. 2. Prompts the user for his/her favorite city which it then stores in a variable of type String. 3. Store the number of letters in the city name in a variable of type int. Figure 3- 4. Display the city name as it was entered by the user and the https://www.colourbox.c number of letters in it. om/vector/cartoon-city- background-vector- 5. Display the city name all in upper case. 10206816 6. Display the city name with the second letter in upper-case. 7. Display the city name with the second to last letter in upper-case. 8. Display the city name with the middle letter in upper-case. Note: The middle letter is the letter at location length() of the word divided by 2. 9. Display a farewell message, so that the user knows that the program has terminated normally. Restrictions: No looping statements allowed (or needed). This questions requires the use of the String functions length(), substring() and toUpperCase(). Following is a sample output screen. Data entered by the user is in green. Youbelowr program should work for any one-word city name entered not just the one in the sample output. Nancy's City Name Manipulator Please enter the name of your favorite city in lower case: istanbul You entered istanbul which has 8 characters. Here is the city name * With all letter in upper case: ISTANBUL * With the second letter in upper case: istanbul * With the second to last letter in upper case: istanbul * With the middle letter in upper case: istanbul Hope you are confortable manipulating String variables now ... Figure 4. Sample output screen for Question 2 Note: Your program must display the same information but can be formatted differently

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!