Question: Part 1 - Arithmetic Operations, Methods Lab 2 A Write a method called kelvins that takes an argument f , the temperature in degrees Fahrenheit

Part 1- Arithmetic Operations, Methods
Lab2A
Write a method called kelvins that takes an argument f, the temperature in degrees Fahrenheit (of type double) and returns the temperature in degrees Kelvin (also a double).
Here is the mathematical formula for conversion:K=59(F32)+273.15
Write another method called temperaturePrinter that takes arguments f and k ,two doubles and prints the following message to the screen:
#.## deg. F equals #.## deg. K
Where #.## are correct values in degrees Fahrenheit (f) and Kelvin (k).
Test your methods with 5 different values for Fahrenheit. Either print the results of each test as they are run and record the results of the tests in comments at the bottom of your code before submitting.
Part 2- More Arithmetic Operations and Methods
Write a method called secondTime that takes an argument, an integer corresponding to a number of seconds. secondTime computes and displays the equivalent time in hours, minutes and seconds, and prints the result to console in the format:
1234 seconds ==00:20:34
Meaning 0 hours, 20 min, 34 seconds
Hint: Use a tool like Tools4NoobsLinks to an external site. to help determine the correct answer so that you can test your code.
Write another method called inSeconds that takes three integer arguments: hours, minutes and seconds. It computes and returns the exact time in seconds, and prints the following message to the console:
00:20:34==1234 seconds
Copy the following tests and paste them in your code and replace X with the outputs you got.

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 Programming Questions!