Answered step by step
Verified Expert Solution
Link Copied!

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 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions