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

  Write applet which reads five numbers-draw equivalent stars

Write the applet which reads five numbers (each between 1 and 30). For each number read, your program must design line containing that number of adjacent asterisks.

  Write down ijvm code to remove top two words from stack

Write down IJVM code which will remove these top two words, multiply and put their product back on stack. You are allowed to use existing IJVM instructions only.

  Record managing system application

Build a student record managing system application

  Implement security so that all users can view the informatio

Implement security so that all users can view the information about the projects, but only authenticated users

  Develop a reliable transfer protocol over udp

Develop a reliable transfer protocol over UDP. Focus on a Stop- and-Wait protocol.

  Evaluate the rtas resource requirements

Design and implement a set of classes and interfaces and use them to evaluate the RTA's resource requirements.

  Mean and standard deviation using using eclipse

Java programming to calculate Mean and standard deviation using Using Eclipse.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Compute area and perimeter of a polygon

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

  Develop java code to compute monthly rent for housing units

Develop a java code that computes monthly rent for 3 housing units namely Bungalows,Apartments and hostels. All housing units have got size,color and monthly rental rate.

  Java program ask user to enter 10-character telephone number

Write a Java program that asks the user to enter a 10-character telephone number in the format XXX-XXX-XXXX. The program should display the telephone number with any alphabetic characters

  Java program to print strings given at command line

Write down program Average.java to print strings which it is given at command line, one per line. If nothing is given at command line, then print "No arguments".

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