1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
katrin [286]
3 years ago
8

Write a program that convert a temperature in Fahrenheit to the equivalent temperature in Celsius. The initial temperature in Fa

hrenheit is to be entered at the keyboard. Both temperatures should be output to the screen.

Computers and Technology
1 answer:
baherus [9]3 years ago
5 0

<u>Answer:</u>

//import the necessary class

import java.util.Scanner;

//Begin class definition

public class ConvertToCelsius{

   

       //Begin main method

    public static void main(String []args){

       //Create an object of the Scanner class

       Scanner input = new Scanner(System.in);

       

       //Display the aim of the program

       System.out.println("**Program to convert from Fahrenheit to Celsius**");

       

       //Prompt the user to enter the temperature in Fahrenheit

       System.out.println("Please enter temperature in Fahrenheit");

       

       //Receive the user's input

       //And store in the appropriate variable

       double tempF = input.nextDouble();

       

       //Convert the temperature to Celsius using

       //C = (9.0 / 5) * (F - 32)

       //C = temperature in Celsius, F = temperature in Fahrenheit

       double tempC = (9.0 / 5) * (tempF - 32);

       

       //Display the result

      System.out.println("The temperature in degree Celsius is: ");

       System.out.println(tempC);

       

       return;

       

    }    //End of main method

}    //End of class definition

<u>Sample Output</u>

**Program to convert from Fahrenheit to Celsius **

Please enter temperature in Fahrenheit

>> 32

The temperature in degree Celsius is:  

0.0

<u>Explanation</u>:

The above code has been written in Java and it contains comments explaining important lines of the code. Please go through the comment. Snapshots of the program and a sample output have been attached to this response.

You might be interested in
Each row in a database is a set of unique information called a(n) (A.)table,(B.)record,(C.)object,(D.)field
sashaice [31]

Answer:

-------------------------######################

4 0
3 years ago
Read 2 more answers
Can Someone help plz?
Ugo [173]

Answer:

i dont understand sorry

Explanation:

7 0
3 years ago
In the world of computing,accessibility MOST often refers to what
Nutka1998 [239]

<span>Accessibility refers to access to some form of computer technology. This means that numbers are easily organized and data is easily calculated making it easier for people’s lives. It is a means of an efficient and more productive existence in the work environment.</span>

5 0
3 years ago
While the Internet can be a great resource, the information is not always reliable, as anyone can post information. Select one:
Olin [163]

Answer: True

Explanation: Because anyone can post something and it can be non reliable

7 0
3 years ago
How do you fix peer answer bad gateway 502. Please help
kondaur [170]

Answer:

Reload the page.

Look for server connectivity issues.

Check for any DNS changes.

Sift through your logs.

Fix faulty firewall configurations.

Comb through your website's code to find bugs.

Contact your host.

Explanation:

7 0
3 years ago
Other questions:
  • You will write a program that reads a binary file that contains records of creatures. Each record can be stored in a Creature st
    10·1 answer
  • How did the discovery of glossopteris support wegner's continental drift hypothesis?
    15·1 answer
  • If you delete a file from removable media, it is stored in the recycle bin where you can recover it until you empty the recycle
    13·1 answer
  • Define a function below called average_strings. The function takes one argument: a list of strings. Complete the function so tha
    11·1 answer
  • Which components exist in the contextual tab for tables called Design? Check all that apply. Table Styles Export Table Data Prop
    11·2 answers
  • When you save a file for the first time, you must ____.
    15·2 answers
  • What is the missing line of code?
    7·1 answer
  • What symbol indicates that material has been copyrighted?
    8·2 answers
  • Write a method for the Invitation class that accepts a parameter and uses it to update the address for the event.
    9·1 answer
  • National ISPs usually offer fewer services and have a smaller technical support staff than regional ISPs.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!