Question: Code the following in Java Use may use only the following concepts as needed: Objects, Exceptions, File Processing. ****Note: You are not allowed to use

Code the following in Java

Use may use only the following concepts as needed: Objects, Exceptions, File Processing.

****Note: You are not allowed to use static methods for this assignment except for main****

Part I

Everyone widely uses a thermostat. We have them in our cars and our electronic devices. We are going to obtain the temperature through digital readings from thermostats. We are going to create 4 classes that will help us convert temperatures. The four classes will be Kelvin, Celsius, Fahrenheit and TemperatureControl. Other than TemperatureControl, each of the classes will have methods that convert temperature from its type to the type of the given class. For example: The Celsius class will have a method that converts Fahrenheit to Celsius and Kelvin to Celsius. Remember all methods in these temperature type classes should return a value and should not return void and do not have print statements. The TemperatureControl class will be the only class with a main. This class will also be the only class with print statements. This class is the only class that the user will be interacting with. The purpose of this class is to ask the user what temperature format they will be entering (ie. Kelvin, Fahrenheit, Celsius). Then ask the user what temperature format they want to convert to. The class will then print the converted temperature.

Part II

Create an additional method to your TemperatureControl class that will print to a text file. You will need to add a try/catch to surround your code. This try/catch is a part of Exceptions. You should have a FileNotFound Exception. This exception should print File not found. The text file name should be called output.txt. The file should contain the output of the converted temperatures.

Part III

Explain the importance of exceptions. Also, explain the importance of having separate objects/classes. Please add this in the comments in your .java file.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!