Question: I. Prompt the user for a valid temperature in degrees Fahrenheit. II. If the user enters a valid temperature in degrees Fahrenheit (i.e. temperature greater
I. Prompt the user for a valid temperature in degrees Fahrenheit.\ II. If the user enters a valid temperature in degrees Fahrenheit (i.e. temperature greater than or\ equal to -459.67), then the program asks the user the temperature scale to perform the\ conversion and displays such a conversion.\ The program TemperatureConverter.java has several logical errors that you need to identify\ and correct using System.out.println and the Eclipse debugger. It may also contain syntax\ error(s) that you should identify and correct.\ 1. After you have downloaded the program TemperatureConverter.java to your computer,\ create a new Java Project called TemperatureConverter in Eclipse, then create a new class\ called TemperatureConverter in the TemperatureConverter Java Project.\ Using Notepad, open the file TemperatureConverter.java you have just downloaded on the\ desktop and copy all of its content into the class TemperatureConverter in your Eclipse project.\ 2. Add System.out.println statements as needed to help you understand and debug the\ program. After debugging, you should remove or comment out these println statements so\ they don't show up in the correct version of your program.\ 3. Compile and run the program.\ 4. Execute the program entering the value 56 at the prompt and enter 3 when prompted for the\ temperature scale.\ o [Worksheet Item 1] What do you observe when you run the program?\ 5. One easy way to debug your program is to print to the console the values of the variables and\ other messages that will help you trace the execution of the program in order to find out the\ logical errors. However, this technique can be very time consuming if you are dealing with larger\ programs. Instead, a more convenient way to locate logical errors in a program is by tracing the\ execution of the program and monitoring the values of the variables using a debugger. For the\ rest of this lab exercise, you will learn the basics of the Eclipse debugger that will help you debug\ and fix logical errors in a Java program.\ From Fahrenheit to Conversion Formula\ Kelvin Degrees [\\\\deg K] = ([\\\\deg F] + 459.67) \\\\times 5/9\ Rankine Degrees [\\\\deg R] = [\\\\deg F] + 459.67\ Reaumur Degrees [\\\\deg Re] = ([\\\\deg F] 32.0) \\\\times 4/9\ Celsius Degrees [\\\\deg C] = ([\\\\deg F] 32.0) \\\\times 5/9
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
