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
vivado [14]
3 years ago
8

Make a program that (i) asks the user for a temperature in Fahrenheit degrees and reads the number; (ii) computes the correspond

ing temperature in Celsius degrees; and (iii) prints out the temperature in the Celsius scale.
Computers and Technology
1 answer:
Lerok [7]3 years ago
5 0
<h2>Answer:</h2><h2></h2>

//import the Scanner class to allow for user's input

import java.util.Scanner;

//Create a class declaration with appropriate name

public class FahrenheitToCelsius {

   //Begin the main method where execution starts from

   public static void main(String[] args) {

       //Create an object of the Scanner class to allow reading from standard

       // input

       Scanner input = new Scanner(System.in);

       

       //Prompt the user to enter the temperature

       System.out.println("Enter a temperature in Fahrenheit degrees");

       

       //Read the number and store in a variable of type double

       double fahrenheit = input.nextDouble();

       

       

       //Convert the temperature to Celsius

       double celsius  = (fahrenheit - 32) * (5 / 9.0);

       

       //Print out the result

       System.out.println("The temperature in Celsius is " + celsius);

       

   } //End of main method

   

}   //End of class declaration

==============================================================

<h2>Sample Output 1:</h2><h2 />

>> Enter a temperature in Fahrenheit degrees

32

>> The temperature in Celsius is 0.0

==============================================================

<h2>Sample Output 2:</h2><h2 />

>> Enter a temperature in Fahrenheit degrees

78

>> The temperature in Celsius is 25.555555555555557

===============================================================

<h2>Explanation:</h2>

The code has been written in Java and it contains comments explaining every segment of the code. Please go through the comments.

The actual lines of code are written in bold face to separate them from the comments.

Sample outputs have also been given to show how the result of the program looks like.

You might be interested in
Which of the following is true? Group of answer choices worst case time of Heapsort is better than worst cast time of Quicksort
Sav [38]

Answer:

Worst case time of Heapsort is better than worst case time of Quicksort.

Explanation:

Worstcase of Heapsort is nlog(n). Worstcase time of Quicksort is (n^2). Heapsort is comparison based sorting algorithm. Heapsort divides input into sorting. It is a selection sort in which we send maximum inputs for maximum elements at end. Quicksort is divide and conquer algorithm. It is considered as efficient sourcing algorithm.

8 0
3 years ago
A non technical kind of cyber intrusion that relies heavily on human interaction and often involve tricking people into breaking
lana66690 [7]
Social Engineering.

---------------------------
4 0
3 years ago
Type the correct answer in the box. Spell the words correctly.
ExtremeBDS [4]

Answer:

The IT field yeah am sure

7 0
3 years ago
When’s The release date for Mobile legends project next phase 3 going To come
Gennadij [26K]

Answer: This Project will involve Hero Revamps, Hero Adjustments, Hero Remodels, and much more. Project NEXT is divided into 2 phases: the first phase was released on September 22, 2020, the second phase was released on June 15, 2021 and the third phase is to be released on "September 2021".

4 0
2 years ago
Zoe runs a sports media website that caters to fans of many different types of sports. She's starting a Google Display Ads campa
Alex

Answer:

Affinity Audiences allow her to reach sports enthusiasts.

Explanation:

Affinity Audiences are usually TV-style audiences normally designed with the aim of trying to connect advertisers with the type of customers they are searching for online at any point in time. Google Ads uses this feature via the browser history of the user and the time spent on pages and then associates the users browser with a category of interest.

8 0
2 years ago
Other questions:
  • Which of the following statements is true?
    11·1 answer
  • From the standpoint of the governing bodies of .com, why is it important that owners of individual domains maintain authoritativ
    5·1 answer
  • ____ is the only automated disk-to-disk tool that allows you to copy data to a slightly smaller target drive than the original s
    5·1 answer
  • Write a machine-language program to add the three numbers 2, –3, and 6 and output the sum on the output device. Write it in a fo
    11·1 answer
  • How are online sources used? Check all that apply.
    8·2 answers
  • Consider the code below. When you run this program, what is the output if the temperature is 77.3 degrees Fahrenheit?
    6·1 answer
  • Which phrase is the best definition of sparklines in Excel 2016?
    8·2 answers
  • Which bits of the address would be used in the tag, index and offset in a two-way set associative cache with 1-word blocks and a
    7·1 answer
  • Your friend says, “I can’t ever watch a streaming movie without it pausing for long moments. It makes me crazy!” What might you
    11·1 answer
  • You discover that the lecturers will be using the laptops for online and video lecturing, and you see the need to upgrade the RA
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!