Compute the temperature in centigrade

Assignment Help JAVA Programming
Reference no: EM1378670

Objective: To learn the use of comments, and basic math operators.

Create a new folder called 'assign21' under C:\Java\Lesson2. Copy HelloWorld.java from Lesson 1 into it, and rename the file to "Temperature.java". Replace the word "HelloWorld" with "Temperature". Replace the System.out line with instructions to declare variables, and display output as described below:

Write a comment in the code that says "Converting degF to degC".

Use the following formula to compute the temperature in Centigrade using the temperature in Fahrenheit:

degree_Centigrade = ( degree_Fahrenheit - 32 ) X 5/9

Display the temperatures in both Centrigrade and Fahrenheit with appropriate labels, using the + operator to concatenate the labels with the variables, each variable on a separate line. For example, the display may look like:

Temperature in Fahrenheit = 75.0

Temperature in Centigrade = 23.88888889

Write another comment in the code that says "Converting degC back to degF". On the next line, declare a new 'double' type variable called 'degFVerify' and then in the next line after that, using the degC computed above, back calculate the temperature in Fahrenheit and assign it to 'degFVerify', using the formula:
degree_Fahrenheit = (degree_Centigrade X 9/5) + 32
Verify that you get back the value of 75.0.

Display another message concatenating a label with the value of 'degFVerify', so that the message may look like:
Temperature in Fahrenheit (Verification) = 75.0
The output session may look like this:
C:\Java\Lesson2\assign21>javac Temperature.java
C:\Java\Lesson2\assign21>java Temperature
Temperature in Fahrenheit = 75.0
Temperature in Centigrade = 23.88888888888889
Temperature in Fahrenheit (Verification) = 75.0

Reference no: EM1378670

Questions Cloud

Identidying uncritical thinking : Suppose you are a new police chief of a section with a history of bias against protected groups, addressing the entire police force.
Perform a blast search : Perform a BLAST search and a result has an E value of about 1 x 10-4. What does this E value mean? What are some parameters on which an E value depends?
Identify ideal ways of life : Ideals and values come into conflict despite our best intentions whenever people from different walks of life come together.
Obligation to the famine victims : Assume you are a part of the nation Eggonia's grand council on ethics. The country has been giving charge of deciding whether or not your nation's citizen are morally obligated to send famine relief to the neighboring country of Furesia.
Compute the temperature in centigrade : Compute the temperature in Centigrade - Display the temperatures in both Centrigrade and Fahrenheit with appropriate labels, using the + operator to concatenate the labels with the variables
Describe consumer service process at csaa : Describe consumer service process at CSAA also discusses different phases of reengineering effort.
Illustrate what trade-offs seem to have been made : One of best illustrations of trade-off also focus comes from shouldice hospital case. Look up their website also ask illustrate what trade-offs seem to have been made.
Illustrate what are advantages also disadvantages : In 150 words can you explain. Illustrate what are advantages also disadvantages of utilizing objective measures of performance.
Importance of subjecting our beliefs to critical scrutiny : Many people have visions that are strongly influenced and informed through philosophy, often without realizing it.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Design and implement an applet called circles

Design and implement an applet called Circles that draws 50 circles of random diameter in random locations. If the diameter of a circle is less than a certain value, the circle is ?lled with the color yellow.

  Program to find maximum-minimum of sequence of values

Common task which should be done in loop is to find maximum and minimum of sequence of values. File Temps.java contains program which reads in sequence of hourly temperature readings over 24- hour period.

  Write a recursive instance method

Write a recursive instance method

  Java program for line item application

This exercise explains you the process of testing and enhancing Line Item application. Open LineItemApp, Validator, Product, LineItem, and ProductDB classes that are in the c:java1.6ch06LineItem directory and review this code.

  Write java program to reads ten values from user

Write the java program which reads 10 values from user and store them in 1 daimantion array. your program will ask the user wich operation he wants to perform:

  Write java programming to show number of credits for course

Write the java programming to solve following problem. We are given a student's marks in Calculus 1, CS1, and Physics 1 (each mark being between 0 and 100) also number of credits for each course.

  Compute area and perimeter of a polygon

Create a project that would let a user compute area and perimeter of a polygon

  Record managing system application

Build a student record managing system application

  Write a program to find solution tocryparithmetic puzzle

Write a program (Crypta.java) that finds a solution to the cryparithmetic puzzle: TOO + TOO + TOO+ TOO = GOOD

  Enterprise java beans (ejb) in software development

Enterprise Java Beans (EJB) in software development, EJB technology, EJB application, Stateless Session Beans (SLSB), Stateful Session Beans (SFSB), Message Driven Bean (MDB), Entity Bean

  Write an interface for an abstract method

Write an interface, PointingDevice, containing:  an abstract method, getXCoord that returns an int and an abstract method, getYCoord that returns an int.

  Define private instance variable to hold boolean value

Write a Java Enumeration "LetterGrade" that represents letter grades A through F including plus and minus grades. Define a private instance variable to hold a boolean value.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd