Reference no: EM131282125
Write a Temperature class that will hold a temperature in Fahrenheit and provide methods to get the temperature in Fahrenheit, Celsius, and Kelvin.
The class should have the following field: . ftemp: a double that holds a Fahrenheit temperature.
The class should have the following methods :
Constructor : The constructor accepts a Fahrenheit temperature (as a double ) and stores it in the ftemp field. . setFahrenheit: The set Fahrenheit method accepts a Fahrenheit temperature (as a double ) and stores it in the ftemp field. . getFahrenheit: Returns the value of the ftemp field as a Fahrenheit temperature (no conversion required) . getCelsius: Returns the value of the ftemp field converted to Celsius.
Use the following formula to convert to Celsius: Celsius = (5/9) * (Fahrenheit - 32) . getKelvin: Returns the value of the ftemp field converted to Kelvin.
Use the following formula to convert to Kelvin: Kelvin = ((5/9) * (Fahrenheit - 32)) + 273
Demonstrate the Temperature class by writing a separate program that asks the user for a Fahrenheit temperature.
The program should create an instance of the Temperature class, with the value entered by the user passed to the constructor.
The program should then call the object 's methods to display the temperature in the following format
for example, if the temperature in Fahrenheit was -40):
The temperature in Fahrenheit is -40.0
The temperature in Celsius is -40.0
The temperature in Kelvin is 233.0
Determine best way to estimate cost of a gallon of gasoline
: Determine the best way to estimate the value of time. Determine the best way to estimate the cost of a gallon of gasoline. Justify your position.
|
Identify the line codes that have minimum average energy
: Identify the line codes that have minimum average energy and those that do not. Compare your answers with the observations made on these line codes.
|
Depending on the person
: The answer to this question will vary depending on the person and his or her values and background. Some students are more focused on day-to-day personal needs and others on broader societal or global concerns.
|
Which of two constellations has minimum average energy
: The two signal constellations shown in Figure exhibit the same average probability of symbol error. Justify the validity of this statement. - Which of these two constellations has minimum average energy?
|
Write a temperature class
: Write a Temperature class that will hold a temperature in Fahrenheit and provide methods to get the temperature in Fahrenheit, Celsius, and Kelvin.
|
Examine this case study in terms how conflict can arise
: Examine this case study in terms how conflict can arise and escalate. The discussion will probably require that you fully investigate the Thai-Cambodian case.
|
What is the author of the story trying to teach his audience
: What literary and dramatic devices, such as plot, character, theme, setting, and symbols, are used in the story to convey messages? Explain how they are used. What might have happened if the Prince had sacrificed his life for the Little Mermaid?
|
Expand its current emergency plan
: Assume that your selected agency received funding to expand its current emergency plan, which involves the Department of Corrections and Department of Juvenile Justice.
|
Estimate the total rate of heat loss from the above-ground
: The insulation maintains the outer surface of the steel sheathing at approximately 10°C. If the ambient temperature averages 0°C and prevailing winds are 2 m/s from the northeast, estimate the total rate of heat loss from the above-ground portion ..
|