SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 2 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 07 Jan 2018 My Price 10.00

Temperature class that will hold a temperature

I need help with two exercises, please.

Write a Temperature class  that will hold a temperature in Fahrenheit and provide methods  to get the temperature in Fahrenheit, Celsius, and Kelvin. The class  should have the
following field:

• ftemp: a double  that holds a Fahrenheit temperature.

The class  should have the following methods :

• Constructor : The constructor  accepts a Fahrenheit temperature (as a double ) and stores  it in the ftemp field.
• setFahrenheit: The set Fahrenheit method  accepts a Fahrenheit temperature (as a double ) and stores  it in the ftemp field.
• getFahrenheit: Returns the value  of the ftemp field as a Fahrenheit temperature (no conversion  required)
• getCelsius: Returns the value  of the ftemp field converted to Celsius. Use the following formula to convert to Celsius:
Celsius = (5/9) * (Fahrenheit - 32)
• getKelvin: Returns the value  of the ftemp field converted to Kelvin. Use the following formula to convert to Kelvin:
Kelvin = ((5/9) * (Fahrenheit - 32)) + 273

Demonstrate the Temperature class  by writing a separate program  that asks the user for a 
Fahrenheit temperature. The program  should create an instance of the Temperature class ,
with the value  entered by the user passed to the constructor . The program  should then
call the object 's methods  to display the temperature in the following format (for example,
if the temperature in Fahrenheit was -40):

The temperature in Fahrenheit is -40.0
The temperature in Celsius is -40.0
The temperature in Kelvin is 233.0

 

Attachments:

Answers

(5)
Status NEW Posted 07 Jan 2018 12:01 PM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)