Question: Create a package called Q 2 . Create a java class named IceBreakers that will include the header and footer with your information that you

Create a package called Q2.
Create a java class named IceBreakers that will include the header and footer with your
information that you created in package Q1.
Define a public static method called kelvinToFarenheit(), which, when called, will accept
a temperature in degree-Kelvin as an argument and return the value in degree-Fahrenheit
with the help of the following expression:
273
5
=
32
9, where K is in degree-Kelvin and f is
in degree-Fahrenheit. The method must have the following header, where you need to
decide on the appropriate data types:
public static dataType kelvinToFahrenheit(dataType kelvin)
Define a public static method called fahrenheitToKelvin(), which, when called, will accept
a temperature in degree-Fahrenheit as an argument and return the value in degree-Kelvin
with the help of the following expression: 273
5
=
32
9, where K is in degree-Kelvin and f is
in degree-Fahrenheit. The method must have the following header, where you need to
decide on the appropriate data types:
public static dataType fahrenheitToKelvin (dataType fahrenheit) Define the driver method (main() method) with the following specifications:
o Call your public static method myHeader() available in the Q1.MyMethods class,
with appropriate arguments. Prior to doing this, on top of the current class
IceBreakers, you need to import the package Q1.MyMethods with the statement
import Q1.MyMethods; where you defined your static methods myHeader() and
myFooter(). This is the advantage of using methods, that will help us cut down
code-repetition. You need to call these methods as MyMethods.myHeader() just
like Math.pow(). Talk to your instructor if this does not make sense.
o Now mimic the conversation between two individuals in a house, as shown in the
sample output, where the temperature values (e.g.,-14.55,18.5 and 72 in the
sample output) will be entered by the user from the keyboard. The tab-space in the
sample output can be created with the escape character \t within double
quotation (see unit 2.3), inside any print statement.
o Call myFooter() method with appropriate argumentDefine the driver method (main() method) with the following specifications:
o Call your public static method myHeader() available in the Q1.MyMethods class,
with appropriate arguments. Prior to doing this, on top of the current class
IceBreakers, you need to import the package Q1.MyMethods with the statement
import Q1.MyMethods; where you defined your static methods myHeader() and
myFooter(). This is the advantage of using methods, that will help us cut down
code-repetition. You need to call these methods as MyMethods.myHeader() just
like Math.pow(). Talk to your instructor if this does not make sense.
o Now mimic the conversation between two individuals in a house, as shown in the
sample output, where the temperature values (e.g.,-14.55,18.5 and 72 in the
sample output) will be entered by the user from the keyboard. The tab-space in the
sample output can be created with the escape character \t within double
quotation (see unit 2.3), inside any print statement.
o Call myFooter() method with appropriate argument Sample output
****************************************************
Full Name: .......
Lab Exercise: 3, Question: 2
Program Description: ..........
*****************************************************
What is the outdoor temperature now? 258.45
I know you're used to Fahrenheit scale. 258.45 deg-K is 5.81 deg-F.
I am cold! What is the indoor temperature? 291.5
291.50 deg-K is 65.30 deg-F.
I see. Would you crank up the temperature?
Ok I will! What temperature should I set the thermostat to?72
Oh, you mean 72.00 deg Fahrenheit! Here you go.
By the way, 72.00 deg-F is 295.22 deg-K.
Thank you! It is very nice of you.
*** Signing off from Question 2 yourFirstName ***

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!