![]() If no input specified the assignment tells you what values to put. 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. 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) 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.To convert from Celsius to Fahrenheit, multiply by 1.8 and add 32. One comparison method to test whether 2 temperatures are the same To convert a temperature from Fahrenheit to Celsius, subtract 32, multiply by 5, and divide by 9.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 If at any point you want to change your Big Sky updates from detailed to basic or Fahrenheit to Celsius, just say, "Alexa, ask Big Sky to update my options.I have to create a temperature conversion project using a method and driver class. ![]() When asking Big Sky the same thing, the response was: "This hour the relative humidity is 50 percent with the wind out of the south-southeast at 3.7 miles per hour." When I asked "Alexa, what's the humidity?," I was told the current conditions and a short forecast - no mention of humidity. If it does rain today, it's likely that the heaviest rain today has already fallen at 12:00am." The overall chance of rain on Monday, July 17, is 8 percent. There's a 41 percent chance." When I asked Big Sky, it responded with: "Likely not. When I asked Alexa if it will rain today, the response was: "It might rain in Concord today. The amount of additional information Big Sky gives you is impressive. ![]() "Alexa, ask Big Sky about the weather this weekend."."Alexa, ask Big Sky what's the weather in New York City?"."Alexa, ask Big Sky when is sunrise on Thursday?"."Alexa, ask Big Sky what's the high temperature in the next seven days?". ![]() "Alexa, ask Big Sky what will the wind speed be in four hours?"."Alexa, ask Big Sky if it will rain tomorrow before noon."."Alexa, ask Big Sky for the humidity at 7 p.m."."Alexa, ask Big Sky will it rain in the next six hours?"."Alexa, ask Big Sky for the weather in three hours.".Here are some other examples of what you can ask Big Sky: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |