After his death, the scale became inverted to what we know today as 0 degrees for the freezing point of water and 100 degrees as the boiling point of water. He set his scale at the boiling point of water to 0 degrees and the freezing point to 100 degrees. The biggest difference included measuring the freezing and boiling points of water, without salt, at sea level. “Fahrenheit used a scale from the temperature of a very cold mixture of water and salt at 0 degrees F, up to normal body temperature, which is nearly 100 deg F.”Īs for Celsius, Anders Celsius developed his scale in 1742, nearly 20 years after Fahrenheit. Metric Association and a Senior Meteorology Research Scientist at Colorado State University’s Cooperative Institute for Research in the Atmosphere, who explained the reasoning behind Fahrenheit and what he and his association are doing to change this.įahrenheit scale, named after Daniel Gabriel Fahrenheit, a German physicist in the 18th century. So our Celsius temperature is going to be 5/9 times the Fahrenheit temperature- the Fahrenheit temperature is 56 degrees Fahrenheit- minus 32. However, nearly the rest of the world goes by the Celsius scale. Well, in this one over here, if you know the Fahrenheit temperature, then you can solve for the Celsius temperature. Here in the United States, we use that Fahrenheit scale. If no input specified the assignment tells you what values to put.There are two widely known temperature scales, Fahrenheit and Celsius. Based on the input calculate the fahrenheitTemp, celsiusTemp like I did in the setDegree. Use the instructions of the assignment to create the 4 constructors. Meaning that your set methods should have arguments and will pass that argument to the class variable. For example, suppose that you read that temperature in a European city you plan to visit today is 18 C. When you set the degree (by Constructor or be a set Method), use the scale to see if it is Celsius or Fahrenheit and use the appropriate formula: public void setDegrees(float degree) To convert Celsius to Fahrenheit, you can also do a quick approximation of the temperature in Fahrenheit by doubling the temperature in Celsius, subtracting 10 percent of your result and adding 32. So don't put any calculations in your get Methods. So you will use the scale to determine that and calculate the results accordingly. When you have a degree as a parameter you don't know if it is in Celsius or in Fahrenheit. IF ANYONE WULD BE ABLE TO HELP ME WITH MY ERRORS IN MY CONSTRUTOR METHOD OR AS LEAST LET ME KNOW WHAT I DID WRONG THAT WOULD GREATLY BE APPRECIATED. Be sure to invoke each of the constructors, to include at least one case where the 2 temperatures are the same and one where they are different. Write a driver program that tests all the methods. One toString to print out one line that describes the temperature.One comparison method to test whether 2 temperatures are the same.Three set methods: one to set the number of degrees, one to set the scale, and one to set both.Two accessor methods: one to return the temperature in degrees Celsius, the other to return it in degrees Fahrenheit.For each of these constructors, assume zero degrees if no value is specified and Celsius if no scale is given. Four constructors: one for the number of degrees, one for the scale, one for both degrees and the scale, and one default constructor.Use a floating-point number for the temperature and a character for the scale: either ‘C’ for Celsius or ‘F’ for Fahrenheit. Write a Temperature class that respresents temperatures in degrees in both Celsius and Fahrenheit. ("The Celsius Temperature is " + celsiusTemp) Īnd here is a full discription of the assignment ("The Fahrenheit Temperature is " + fahrenheitTemp) Now here is what my driver class looks like: public class TempConverterįahrenheitTemp = degree1.fahrenheitTemp() Return "Celsius Temperature: " + celsiusTemp Return "Fahrenheit Temperature: " + fahrenheitTemp Here is what my constructor method looks like public class Degree i did it b4 put only as one file, i started the driver class but when i compile i get a couple errors the errors i get are:ĭegree.java:30: illegal start of expressionĭegree.java:24: Degree(float) is already defined in Degree I have to create a temperature conversion project using a method and driver class.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |