subject
Computers and Technology, 06.05.2020 02:28 bbb4951

Write a Temperature class that will hold a temperature in Fahrenheit and provide methodsto get the temperature in Fahrenheit, Celsius, and Kelvin. The class should have the followingfield: 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 ) andstores it in the ftemp field. setFahrenheit —The setFahrenheit method accepts a Fahrenheit temperature (as adouble ) and stores it in the ftemp field. getFahrenheit —Returns the value of the ftemp field, as a Fahrenheit temperature (noconversion 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)) _ 273Demonstrate the Temperature class by writing a separate program that asks the user for aFahrenheit 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 callthe object’s methods to display the temperature in Celsius and Kelvin. USING BLUE J PROVIDE TWO SOURCE CODE SHOWING RELATIONSHIP OF THE CODE AND OUTPUT. ONE CODE WITH TEMPERATURE AND OTHER WITH TEMPERATUREDEMO. IN TOTAL, YOU SHOULD SUBMIT 6 SOURCE CODE EACH HAS TWO SOURCE CODE. BELOW IS THE SAMPLE OF HOW SHOULD LOOKpublic class HelloWorldDemo{public static void main(String [] args) {HelloWorld myMessage = new HelloWorld();System. out. println(myMessage. getMessage());}}public class HelloWorld{private final String MSG="Hello World";public String getMessage(){return MSG;}}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 20:30
Which key should you press to leave the cell as it originally was? a. delete b. cancel c. backspace d. enter
Answers: 1
question
Computers and Technology, 25.06.2019 05:00
What should you do if a dialog box covers an area of the screen that you need to see?
Answers: 1
question
Computers and Technology, 25.06.2019 09:20
Part d: float check string has a method s.isdigit() that returns true if string s contains only digits and false otherwise, i.e. s is a string that represents an integer. write a function named float_check that takes one parameter that is a string and returns true if the string represents a float and false otherwise. for the purpose of this function we define a float to be a string of digits that has at most one decimal point. note that under this definition an integer argument will return true. remember “edge cases” such as “45.” or “.45”; both should return true. for example: float_check('1234') returns true float_check('123.45') returns true float_check('123.45.67') returns false float_check('34e46') returns false float_check('.45') returns true float_check('45.') returns true float_check('45..') returns false
Answers: 2
question
Computers and Technology, 25.06.2019 17:00
Ajay wants to read a brief overview about early settlers in the united states which type of online text sources should he most likely use
Answers: 3
You know the right answer?
Write a Temperature class that will hold a temperature in Fahrenheit and provide methodsto get the t...
Questions
question
Mathematics, 12.08.2020 08:01
question
Mathematics, 12.08.2020 08:01
question
Biology, 12.08.2020 08:01