Question: Part A: Temperature Write a Java program that prompts the user to enter the name of a city. Your program should work even if the

 Part A: Temperature Write a Java program that prompts the user
to enter the name of a city. Your program should work even

Part A: Temperature Write a Java program that prompts the user to enter the name of a city. Your program should work even if the city name includes one or more words, such as "Fredericton" or "Saint John" or "Baton Rouge". Also ask the user for the current Celsius temperature in that city. Keep in mind that temperature values might be entered as a number like 18.5 Then ask the user for a second city name and the Celsius temperature in that city. Once you've received the information for both cities, convert the two temperatures to Fahrenheit and print output similar to the following: Saint John is 18.5C, which is 65.3F Los Angeles is 32.0C, which is 98.6F Use different city names and temperature values than those shown above. Be sure to test at least one city name that includes a blank in the middle. Also test at least one temperature value with a non-zero digit to the right of the decimal point. It is okay if your output includes multiple digits to the right of the decimal point. If you re unsure how to convert Celsius to Fahrenheit amounts, learning how to research questions like this is part of the assignment. Rather than asking your instructor for the formula, do a bit of research to look it up. Part B: Time Write a Java program that asks the user to enter an amount of time as a combination of hours, minutes, and seconds, then prints the equivalent amount of time as a number of seconds. It is okay if your output includes multiple digits to the right of the decimal point. If you're unsure how to convert Celsius to Fahrenheit amounts, learning how to research questions like this is part of the assignment. Rather than asking your instructor for the formula, do a bit of research to look it up. Part B: Time Write a Java program that asks the user to enter an amount of time as a combination of hours, minutes, and seconds, then prints the equivalent amount of time as a number of seconds. For example, 1 hour, 10 minutes, and 17 seconds is the equivalent of 4217 seconds. Clearly label your output, including the three values you received from the user. Run your program three separate times to test it with the following test cases: 1. All three input values are groater than 2 2. The user enters 0 hours and the other two input values are greater than 2 3. The user enters 0 hours and 0 minutes and a number of seconds greater than 2

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!