Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 Q
Create a java class named IceBreakers that will include the header and footer with your
information that you created in package Q
Define a public static method called kelvinToFarenheit which, when called, will accept
a temperature in degreeKelvin as an argument and return the value in degreeFahrenheit
with the help of the following expression:
where K is in degreeKelvin and f is
in degreeFahrenheit. The method must have the following header, where you need to
decide on the appropriate data types:
public static dataType kelvinToFahrenheitdataType kelvin
Define a public static method called fahrenheitToKelvin which, when called, will accept
a temperature in degreeFahrenheit as an argument and return the value in degreeKelvin
with the help of the following expression:
where K is in degreeKelvin and f is
in degreeFahrenheit. 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 QMyMethods class,
with appropriate arguments. Prior to doing this, on top of the current class
IceBreakers, you need to import the package QMyMethods with the statement
import QMyMethods; where you defined your static methods myHeader and
myFooter This is the advantage of using methods, that will help us cut down
coderepetition. 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 eg and in the
sample output will be entered by the user from the keyboard. The tabspace in the
sample output can be created with the escape character t within double
quotation see unit 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 QMyMethods class,
with appropriate arguments. Prior to doing this, on top of the current class
IceBreakers, you need to import the package QMyMethods with the statement
import QMyMethods; where you defined your static methods myHeader and
myFooter This is the advantage of using methods, that will help us cut down
coderepetition. 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 eg and in the
sample output will be entered by the user from the keyboard. The tabspace in the
sample output can be created with the escape character t within double
quotation see unit inside any print statement.
o Call myFooter method with appropriate argument Sample output
Full Name:
Lab Exercise: Question:
Program Description:
What is the outdoor temperature now?
I know you're used to Fahrenheit scale. degK is degF
I am cold! What is the indoor temperature?
degK is degF
I see. Would you crank up the temperature?
Ok I will! What temperature should I set the thermostat to
Oh you mean deg Fahrenheit! Here you go
By the way, degF is degK
Thank you! It is very nice of you.
Signing off from Question yourFirstName
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started