Objective to learn the use of comments and basic math

Assignment Help JAVA Programming
Reference no: EM13371081

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

Questions Cloud

Questionsthe kinetic energy stored in the rotor of a 75mva : questionsthe kinetic energy stored in the rotor of a 75mva four pole 50hz synchronous machine is 200 mj. the input
1 sandra has three suitors and has to decide which to take : 1 sandra has three suitors and has to decide which to take to the big dance.nbsp their romance geekiness and the chance
Background to the national trust factthe national trust : background to the national trust factthe national trust cares for over 248000 hectares of countryside in england wales
1aphrodisin and odorant-binding protein are both examples : 1.aphrodisin and odorant-binding protein are both examples of lipocalins. first obtain the accession numbers for
Objective to learn the use of comments and basic math : objective to learn the use of comments and basic math operators.create a new folder called assign21 under
1consider a room 3 m x 3m x 3m with one faccedilade made of : 1.consider a room 3 m x 3m x 3m with one faccedilade made of glazing with diffuse transmittance 0.6 and reflectance
Description of the datasetwe will be using a dataset on : description of the datasetwe will be using a dataset on neighborhood effects for this assignment.these data are drawn
Problemst co is a closely held corporation incorporated : problemst co. is a closely held corporation incorporated under the laws of the state of delaware with 100 shares of
1pt barnum is concerned about the health of his star : 1.p.t. barnum is concerned about the health of his star trapeze artist. if the artist is capable of performing a triple

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a program that evaluates the day of the week for new

write a program that evaluates the day of the week for new years day in the year 3000. to do this you must create your

  Writing a simple gui application using a class called myguic

writing a simple GUI application using a class called MyGuiClass. Your GUI will have a JButton which your program will need to respond to when it is clicked. Describe what you would need to do to setup event handling using a nested inner class. Use J..

  An infix to postfix method for my java program.

an infixToPostFix method for my java program. The method must work with stacks and it should take a string as parameter. The method should be able to convert to postfix mathematic expressions such as: (12 + 4) - 23(9-6)/12. Treat the parenthesis as l..

  Write an object-oriented java program to manipulate data

I want a simple java solution matching all the specifications in the document. The java program has to be made using Eclipseversion 4.2.1.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Develop a java program

Develop a Java program which, given the width, length and depth (in metres), of a swimming pool, determines and outputs.

  Java program which handles events from different sources

how to setup a program to respond to events from any one of these sources. How do you create the necessary listener class? How do you associate the listener object with the event source?

  Class sorter which contains methods for selection sort

Write a class Sorter which contains methods for selection sort, insertion sort and bubble sort (start with the code below). Then create a client class which asks user to enter ten numbers using arrays. Then the program asks user which sorting algo..

  A remote web-based file storage application

Develop a web-based application. The server-side part of the application must be developed using Java Servlets (possibly including JSP). The development of the client (browser) side will typically be a combination of HTML and Javascript.

  Create a class named student that has three member variables

Create a class named Student that has three member variables

  What was in mind of the coder in each part of the code

Need a video that goes through all this java code - as if it was a tutorial showing it line by line - and explain in detail the structure of it all as if you code it yourself.

  Program that uses random instead of scanner to play

Write a Java Program that uses Random instead of Scanner to play many rounds of Rock Paper Scissors. The user and computer will each randomly pick one and common rules of winning apply

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