Question: Please read carfully this is for java object oriented design So i need two codes as instructed in the first 2 pages The last tow
Using two classes, create a program that can convert a Fahrenheit temperature to Celsius and Kelvin. Temperature Class (Temperature.java) Should have one private field, a double, named fTemp. . Should have a no-arg constructor that simply initializes fTemp to 1. Should have a public mutator method named setTemperature that accepts a double as an argument. Name the parameter fTempln . This method should overwrite fTemp with the value of the argument passed in to the method o Should have a public accessor method named getTemperature that returns the value of fTemp. Should have a public accessor method named toCelsius that returns the temperature (value of fTemp) in Celsius. F to C conversion: (fTemp-32) * (5/9) .Should have a public accessor method named toKelvin that returns the temperature (value of fTemp) in Kelvin F to K conversion: (fTemp + 459.67) (5/9) . Neither the toCelsius or toKelvin method should overwrite or alter the value of the fTemp field. TemperatureDemo Class (TemperatureDemo.java) This is the class that will demo the Temperature class you created; thus, it contains the main In the main method method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
