Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 10 Weeks Ago, 5 Days Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
I need help with this program. The if else statements I understand, it is the void method must be named printTemp that I am having issues with and its placement to the main method.
Write a program with a void method. Name the program Temp.java.
Â
The void method must be named printTemp. There will also be a main method that prompts the user for the fahrenheit temperature and calls the method.
Â
printTemp will read in a double temperature , passed to it by the main method, and printTemp will determine solid, liquid or gas, depending on the state which water exists at this temperature (fahrenheit), and display the appropriate message. If you don't know the states of water at what temperatures, Google to learn this.
Â
Here is a sample run: your output must look like this to receive full credit.
Â
Please enter the temperature: 21
Â
Water is a solid at 21 degrees.
Â
--------------------------------------------------
Â
Here is another run:
Â
Â
Please enter the temperature: 215
Â
Water is a gas at 215 degrees.