Write a Temperature class that will hold a temperature in Fahrenheit, and provide meth- ods 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 setFahrenheit 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. getKelvin – Returns the value of the ftemp field converted to Kelvin. Use the following formula to convert the Fahrenheit temperature to Celsius: Celsius = (5/9) * (Fahrenheit - 32) Use the following formula to convert the Fahrenheit temperature to Kelvin: Kelvin = ((5/9) * (Fahrenheit - 32)) + 273 Demonstrate the Temperature class by writing a separate program called TemperatureDemo 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 Celsius and Kelvin.
Thanks for posting the question, we are glad to help you. Here are the two classes you will need. I ran the code and its calculating the celsius and kelvin temperature accurately.
Check the screenshot at the end
thank you & please do give a thumbs up from your end !!
______________________________________________________________________________
//Write a Temperature class that will hold a temperature in Fahrenheit,
public class Temperature {
//ftemp – A double that holds a Fahrenheit temperature.
private double ftemp;
//Constructor – The constructor accepts a Fahrenheit temperature (as a double)
// and stores it in the ftemp field.
public Temperature(double ftemp) {
this.ftemp = ftemp;
}
//The setFahrenheit method accepts a Fahrenheit temperature (as a double)
// and stores it in the ftemp field
public void setFtemp(double ftemp) {
this.ftemp = ftemp;
}
//getFahrenheit – Returns the value of the ftemp field, as a Fahrenheit
// temperature (no conversion required).
public double getFtemp() {
return ftemp;
}
//getCelsius – Returns the value of the ftemp field converted to Celsius.
public double getCelsius() {
return (getFtemp() - 32) * 5.0 / 9;
}
public double getKelvin() {
return getCelsius() + 273.15;
}
}
____________________________________________________________________________
import java.util.Scanner;
public class TemperatureDemo {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter a temperature in Fahrenheit: ");
double ftemp = scanner.nextDouble();
//The program should create an instance of the Temperature class,
// with the value entered by the user passed to the constructor.
Temperature thermometer = new Temperature(ftemp);
//The program should then call the object’s methods to display the
// temperature in Celsius and Kelvin.
System.out.println("Temperature in Celsius : " + thermometer.getCelsius() + " deg C");
System.out.println("Temperature in Kevin : " + thermometer.getKelvin() + " deg K");
}
}
____________________________________________________________________________

thank you !!
Write a Temperature class that will hold a temperature in Fahrenheit, and provide meth- ods to...
Temperature Converter Create a temperature conversion program that will convert the following to Fahrenheit: Celsius Kelvin Newton Your program should take a character which represents the temperature to convert from and a value to be converted to using the following specification: C - Celsius K - Kelvin N - Newton In addition your program should take in the following character to exit the program: X - eXit the program The numeric input for your program should be of type double....
Write a program named FahrenheitToCelsius that accepts a temperature in Fahrenheit from a user and converts it to Celsius by subtracting 32 from the Fahrenheit value and multiplying the result by 5/9. Display both values to one decimal place. For example, if 88.5 degrees is input, the output would be: 88.5 F is 31.4 C Answer in C# (Posting incomplete code i have so far that wont run correctly.) using System; using static System.Console; class FahrenheitToCelsius { static void Main()...
For this assignment you will create a program converting Fahrenheit temperatures to Celsius temperatures. The formula for converting a temperature from Celsius to Fahrenheit is: F = C x 1.8 + 32, where F is the Fahrenheit temperature and C is the Celsius temperature. Write a function named Fahrenheit that accepts a Celsius temperature as an argument and returns the temperature converted to Fahrenheit. Demonstrate the function by accepting a Celsius temperature from a user and displaying the temperature converted...
c++ please
2. (50 points) Create a Temperature class that internally stores a temperature in degrees Kelvin as a double. Create mutator functions named setTempKelvin, setTempFahrenheit, and set TempCelsius that take an input temperature in the specified temperature scale (i.e. Kelvin, Fahrenheit, and Celsius, respectively), and convert the temperature to Kelvin, and store that temperature in the class member private variable (only in Kelvin, no other scales). Also, create functions that return the stored temperature in degrees Kelvin, Fahrenheit, or...
In Python, write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as follows: F=(9/5)C+32 The program should ask the user to enter a temperature in Celsius, then display the temperature converted to Fahrenheit.
Write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as follows: F=95C+32 The program should ask the user to enter a temperature in Celsius, and then display the temperature converted to Fahrenheit. I'm doing this on Python.
Using the latest version of Java JDK, Create a version of this TempConverter program to convert from Fahrenheit to Kelvin. Read the Fahrenheit temperature from the user. public class TempConverter { //----------------------------------------------------------------- // Computes the Fahrenheit equivalent of a specific Celsius // value using the formula F = (9/5)C + 32. //----------------------------------------------------------------- public static void main (String[] args) { final intBASE = 32; final double CONVERSION_FACTOR = 9.0 / 5.0; double fahrenheitTemp; intcelsiusTemp= 24; // value to convert fahrenheitTemp= celsiusTemp*...
This project is for my intro to C++ class. Below is the wording for the project. "In this module, you learned about creating functions in C++ and how to combine functions with the concepts covered in previous modules to solve problems. For this assignment you will create a program converting Fahrenheit temperatures to Celsius temperatures. The formula for converting a temperature from Celsius to Fahrenheit is: F = C x 1.8 + 32, where F is the Fahrenheit temperature and...
Java please The kelvin is the base unit of temperature in the International System of Units (SI), having the unit symbol K. It is named after the Belfast-born, Glasgow University engineer and physicist William Thomson, 1st Baron Kelvin (1824–1907). It uses absolute zero as its null point. The Celsius scale, also known as the centigrade scale, is a temperature scale used by the International System of Units (SI). The Celsius scale is based on 0 °C for the freezing point...
C++ Code needed Celsius Temperature Table The formula for converting a temperature from Fahrenheit to Celsius is C =5/9(F -32) where F is the Fahrenheit temperature and C is the Celsius temperature. Write a function named celsius that accepts a Fahrenheit temperature as an argument. The function should return the temperature, converted to Celsius. Demonstrate the function by calling it in a loop that displays a table of the Fahrenheit temperatures 0 through 20 and their Celsius equivalents.