Question: Write a program that asks the user to enter a number of cities and store them in an array called cities. Then ask the user

Write a program that asks the user to enter a number of cities and store them in an array called cities. Then ask the user to enter a letter. Print all the cities that begin with that letter first, and then print all the cities that have the letter in their name (note you need to deal with case upper and lower case). Test this with two outputs where you have changed the array elements and create arrays of different lengths.

Write a program that asks the user to enter a number of

--jGRASP exec: java Lab7_Cities Enter the number of cities to enter: 5 Enter cityl: Toronto Enter city2: Belleville Enter city3: Halifax Enter city4: Ottawa Enter city5: Detroit Enter a letter T Cities that start with T: Toronto All cities that contain T: Toronto Ottawa Detroit jGRASP: operation complete

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!