Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java program that asks the user to enter the name of his or her favorite city. Use a String variable to store the

Write a Java program that asks the user to enter the name of his or her favorite city. Use a String variable to store the input. The program should display the following:

The number of characters in the city name

The name of the city in all uppercase letters The name of the city in all lowercase letters The first character in the name of the city

Please refer to the test cases below for the exact input/output messages.

TestCase1:

Enter the name of your favorite city: Los Angeles You Entered: Los Angeles Uppercase: LOS ANGELES Lowercase: los angeles Number of Characters: 11 First Character: L

TestCase2

Enter the name of your favorite city: Santa Monica You Entered: Santa Monica Uppercase: SANTA MONICA Lowercase: santa monica Number of Characters: 12 First Character: S

Example: Los Angeles

image text in transcribed

1 Enter the name of your favorite city: 2 You Entered: Los Angeles 3 Uppercase: LOS ANGELES 4 Lowercase: los angeles 5 Number of Characters: 11 6 First Character: L

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Explain in detail the different methods of performance appraisal .

Answered: 1 week ago

Question

Organizing Your Speech Points

Answered: 1 week ago