using java programing

profilesalansari95
hw3.pdf

Launch NetBeans and create a new project named CPS150_HW3. Then:

• Delete the auto-generated main class file (CPS150_HW3.java)

• Download the replacement CPS150_HW3.java file into the project source folder (e.g.,Documents\NetBeansProjects\CPS150_HW3\src\cps150_hw3)

• Download the input file CPS150_HW3_input.txt file into the project folder (e.g., Documents\NetBeansProjects\CPS150_HW3)

• In the Project explorer, right-click on the downloaded CPS150_HW3.java and select the Refactor > Move... menu option When the confirmation dialog appears, click the Refactor button

• Type your section number where indicated and your name after the @author tag in the comment block before the class definition; i.e.:

/** * CPS 150, Section *** type your section number here *** * * Homework Assignment 3 * * @author type your name here */

• Using the conversion table shown here, complete the method definitions for the following conversion methods:

o celsiusToFahrenheit(double) -> double

o fahrenheitToCelsius(double) -> double

o celsiusToKelvin(double) -> double

o kelvinToCelsius(double) -> double

o fahrenheitToRankin(double) -> double

o rankinToFahrenheit(double) -> double

o fahrenheitToKelvin(double) -> double

o kelvinToFahrenheit(double) -> double

o celsiusToRankin(double) -> double

o rankinToCelsius(double) -> double

o kelvinToRankin(double) -> double

o rankinToKelvin(double) -> double

• Compile and run the program. Make sure the actual outputs match the expected outputs shown below.

*** testing the celsiusToFahrenheit conversion method ***

0.00 degrees Celsius = 32.00 degrees Fahrenheit

100.00 degrees Celsius = 212.00 degrees Fahrenheit

-40.00 degrees Celsius = -40.00 degrees Fahrenheit

*** testing the fahrenheitToCelsius conversion method ***

32.00 degrees Fahrenheit = 0.00 degrees Celsius

212.00 degrees Fahrenheit = 100.00 degrees Celsius

-40.00 degrees Fahrenheit = -40.00 degrees Celsius

*** testing the celsiusToKelvin conversion method ***

0.00 degrees Celsius = 273.16 degrees Kelvin

100.00 degrees Celsius = 373.16 degrees Kelvin

-40.00 degrees Celsius = 233.16 degrees Kelvin

*** testing the kelvinToCelsius conversion method ***

273.16 degrees Kelvin = 0.00 degrees Celsius

373.16 degrees Kelvin = 100.00 degrees Celsius

233.16 degrees Kelvin = -40.00 degrees Celsius

*** testing the fahrenheitToRankin conversion method ***

32.00 degrees Fahrenheit = 491.69 degrees Rankin

212.00 degrees Fahrenheit = 671.69 degrees Rankin

-40.00 degrees Fahrenheit = 419.69 degrees Rankin

*** testing the rankinToFahrenheit conversion method ***

491.69 degrees Rankin = 32.00 degrees Fahrenheit

671.69 degrees Rankin = 212.00 degrees Fahrenheit

419.69 degrees Rankin = -40.00 degrees Fahrenheit

*** testing the fahrenheitToKelvin conversion method ***

32.00 degrees Fahrenheit = 273.16 degrees Kelvin

212.00 degrees Fahrenheit = 373.16 degrees Kelvin

-40.00 degrees Fahrenheit = 233.16 degrees Kelvin

*** testing the kelvinToFahrenheit conversion method ***

273.16 degrees Kelvin = 32.00 degrees Fahrenheit

373.16 degrees Kelvin = 212.00 degrees Fahrenheit

233.16 degrees Kelvin = -40.00 degrees Fahrenheit

*** testing the celsiusToRankin conversion method ***

0.00 degrees Celsius = 491.69 degrees Rankin

100.00 degrees Celsius = 671.69 degrees Rankin

-40.00 degrees Celsius = 419.69 degrees Rankin

*** testing the rankinToCelsius conversion method ***

491.69 degrees Rankin = 0.00 degrees Celsius

671.69 degrees Rankin = 100.00 degrees Celsius

419.69 degrees Rankin = -40.00 degrees Celsius

*** testing the kelvinToRankin conversion method ***

273.16 degrees Kelvin = 491.69 degrees Rankin

373.16 degrees Kelvin = 671.69 degrees Rankin

233.16 degrees Kelvin = 419.69 degrees Rankin

*** testing the rankinToKelvin conversion method ***

491.69 degrees Rankin = 273.16 degrees Kelvin

671.69 degrees Rankin = 373.16 degrees Kelvin

419.69 degrees Rankin = 233.16 degrees Kelvin

IMPORTANT! You are not allowed to modify the program code (i.e., the main method) in any way! Doing so will result in a grade of zero (0) for this assignment!