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
You are given a class named Clock that has one int instance variable called hours.
Vlad [161]

Answer:

public Clock(int hours) {

       this.hours = hours;

   }

Explanation:

In Java programming language, Constructors are special methods that are called to initialize the variables of a class when a new object of the class is created with the new keyword. Consider the complete code for the class below;

<em>public class Clock {</em>

<em>    private int hours;</em>

<em>    public Clock(int hours) {</em>

<em>        this.hours = hours;</em>

<em>    }</em>

<em>}</em>

In this example above,  an object of this class can created with this statement Clock myclock = new Clock(6); This is a call to the constructor and passes a parameter (6) for hours

7 0
3 years ago
Please Complete in Java a. Create a class named Book that has 5 fields variables: a stock number, author, title, price, and numb
Gala2k [10]

Answer:

Explanation:

The following code is written in Java. I created both versions of the program that was described in the question. The outputs can be seen in the attached images below. Both versions are attached as txt files below as well.

Download txt
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> txt </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> txt </span>
13e8818abb53c8bc7547a966a10a101d.jpg
8623bf9304771a3e1c8581a41a9c11f6.jpg
8 0
2 years ago
Question 5) What is a feature of podcasts?
steposvetlana [31]

Answer:

the answer is a.they rely on airwaves for broadcasting

Explanation:

i just took this test on brainly

6 0
3 years ago
Read 2 more answers
In which situations would a text-to-speech tool be useful? Check all that apply. O A reader needs to hear a word pronounced. A s
spin [16.1K]

Answer:

The answer to this question is given below in the explanation section

Explanation:

The correct answer is :

A reader needs to hear a word pronounced

A student needs to take notes about a text

Because, text to speech tools mostly used to hear the text written in some files such as reading text from pdf file etc, or word pronunciation. However other options are not right because, reading a difficult material does not make sense with reading it links to understanding.

However, speech to text can be used by the student to take notes while listening the text, but would be easy instead of taking notes and listening, it is easy to copy the text.

7 0
3 years ago
Read 2 more answers
Todd, a manager at Dexter Manufacturing, has received a grievance filed by a group of his subordinates who are union members. Wh
romanna [79]

Answer:

B. The employees contact the labor union arbitrator, who then sends an e-mail to Todd.

Explanation

Todd, 5he manager has just received a grievance filed by his subordinates who are union members because of a dispute.

A grievance can be filed when there is dissatisfaction at work, or anger at policy or something else that is a work related grievance.

The likeliest scenario for escalating their dissatisfaction to their employee would be to present their grievance through their union arbitrator who is charged with protecting the work interests of its union members.

This is necessary because the employer knows the anger of the employees and dialogue can take place.

7 0
3 years ago
Other questions:
  • What is a good monitor for console gaming? (Any price)
    13·2 answers
  • Dennis is driving a car with his family onboard. His children are sitting on the backseat. They have a tablet and want to watch
    13·1 answer
  • The purpose of a lockout tagout checklist is to​
    9·2 answers
  • Select the correct answer.
    12·2 answers
  • Which of the following is not a property of a WAN:
    13·1 answer
  • The CUSTOMERS and SALES tables contain these columns:
    6·1 answer
  • Which slide elements must claire use to enhance her presentation?
    10·2 answers
  • Which of the following is a good precaution to take when making online purchases? (1 point)
    15·1 answer
  • Where are parameters such boot order, processor voltage, motherboard raid, hardware virtualization support, and overclocking con
    7·1 answer
  • Is e commerce a challenge or opportunity to the freight forwarder
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!