Write a program that prompts the user to enter cities and end when done write a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that prompts the user to enter cities and end when done write a loop that prints out the first letter for each city. You must use a loop for this program SAMPLE RUN #1: java Firstlettercities Enter a city (end when done): Dallas Enter a city (end when done): San Joser Enter a city (end when done): Austin Enter a city (end when done): end- The first letter of each city is: D A SAMPLE RUN #2: java FirstLettercities Enter a city (end when done): Chicago Enter a city (end when done): Los Angeles- Enter a city (end when done): Atlanta Enter a city (end when done): Dallas- Enter a city (end when done): San Jose Enter a city (end when done): end- The first letter of each city is: Write a program that prompts the user to enter cities and end when done write a loop that prints out the first letter for each city. You must use a loop for this program SAMPLE RUN #1: java Firstlettercities Enter a city (end when done): Dallas Enter a city (end when done): San Joser Enter a city (end when done): Austin Enter a city (end when done): end- The first letter of each city is: D A SAMPLE RUN #2: java FirstLettercities Enter a city (end when done): Chicago Enter a city (end when done): Los Angeles- Enter a city (end when done): Atlanta Enter a city (end when done): Dallas- Enter a city (end when done): San Jose Enter a city (end when done): end- The first letter of each city is:
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner public class FirstLetterCities public static void mainString args Scanner ... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
Write a program that prompts the user to enter three strings. Compare the String objects lexicographically and print the middle-valued string. For example, if the three strings were "abcd", "wxyz",...
-
Write a program that prompts the user to enter the length from the center of a pentagon to a vertex and computes the area of the pentagon, as shown in the following figure. The formula for computing...
-
Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if the user entered month 2 and year 2012, the program should display that...
-
find the steady state expression for vo in the circuit fig 9.32 if ig = 500cos2000tmA 3) 9.32 Find the steady-state expression for u,, in the circuit of Fig. P9.32 if i = 500 cos 2000 mA. Figure...
-
The U.S. Golf Association (USGA) sets performance standards for golf balls. For example, the initial velocity of the ball may not exceed 250 feet per second when measured by an apparatus approved by...
-
The following financial statement information is from five separate companies. Required 1. Answer the following questions about Company V: a. What is the amount of equity on December 31, 2015? b....
-
Suppose that two drugs A and B are to be tested on 12 subjects' eyes. The drugs will be randomly assigned to the left eye or right eye based on the flip of a fair coin. If the coin toss is heads then...
-
An electronically excited state of Hg can be quenched by N, according to Hg* (g) + Nz (g, V = 0) -7 Hg (g) + N, (g, v = 1) in which energy transfer from Hg* excites Nz vibrationally. Fluorescence...
-
1. Using MATLAB, plot the three elements of the strain vector when the above material is oriented at (1) 0 and (2) at 30. This is accomplished by incrementally applying stress (i.e., 5 psi, 10 psi,...
-
Moeco has issued some commercial paper with 6 months to repayment and a face value of $9.5 million and it just sold in the open-market for $3.2 million. What is the implied effective annual rate of...
-
Complete the questions for the enclosed case, Cat & Joe Case. Required Questions:1. List and briefly describe the advantages and disadvantages inherent to the food truck business model as...
-
Discuss the investment products available which allow self-managed super funds to achieve the same results as a leveraged investment, without the need for borrowing.
-
Firm ABC's balance sheet reported fewer current assets than current liabilities on fiscal year end of 12/31/2019. All else equal, had the firm made more of the cash payments owed to suppliers...
-
Today's price of Apple (AAPL) is $200 per share. AAPL does not pay dividends. One year from today, there are two possible states. In the u state, the economy is booming and the price of AAPL is $400....
-
Assume that a country experiences a financial crisis that causes the nation's financial markets to freeze in a manner that prevents a private firm from raising capital from any source. Explain how...
-
XII. Insufficient Funds A. What is that? B. What does the bank do? C. How do you handle this in QBO? 1. Create two service items: Describe why we use these? a) Bounced Check Amount - (1) What income...
-
Suppose that your group is managing a bond portfolio of around US$50 million in a licensed asset management firm in Hong Kong. The portfolio simply invests in various bond funds. Your boss wants your...
-
Graph one period of each function. y = 4 cos x
-
Write a program that enables the user to specify the location and size of the circles and displays whether the two circles intersect, as shown in Figure 16.39a. Enable the user to point the mouse...
-
Write a program that simulates car racing, as shown inFigure 15.34a. The car moves from left to right. When it hits the right end, it restarts from the left and continues the same process. You can...
-
The reverse method in Section 7.7 reverses an array by copying it to a new array. Rewrite the method that reverses the array passed in the argument and returns this array. Write a test program that...
-
A converging lens creates a real, inverted image. For this to occur, the object must be A. Closer to the lens than the focal point. B. Farther from the lens than the focal point. C. At the focal...
-
Kara has a near-point distance of 40 cm. So that she can focus on a book 25 cm away, her corrective lenses should create A. A virtual image of the book 40 cm from her eye. B. A real image of the book...
-
The screen in a pinhole camera is moved farther away from the pinho le. The image on the screen will A. Become larger. B. Become smaller. C. Remain the same size.
Study smarter with the SolutionInn App