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
1What kind of rules protect everyone’s rights when we use each other’s content
Tanya [424]

Answer:

1. Copyright.

2. Songs and books.

Explanation:

A copyright law can be defined as a set of formal rules granted by a government to protect an intellectual property by giving the owner an exclusive right to use while preventing any unauthorized access, use or duplication by others.

For example, when an individual downloads a song owned by any record company without paying a purchase fee, it is a violation of copyright law.

A copyright can be defined as an exclusive legal right granted to the owner of a creative work (intellectual property) to perform, print, record, and publish his or her work. Also, the owner is granted the sole right to authorize any other person to use the creative work.

Hence, copyright is a kind of rules that protect everyone’s rights when we use each other’s content.

An intellectual property can be defined as an intangible creation of the human mind, ideas, thoughts or intelligence. Some examples of an intellectual property are songs, books, poems, technology, design etc.

3 0
3 years ago
HELP 10 POINTS
Masja [62]

Answer:

it's A:state the role each member played in the project

6 0
3 years ago
Which of the following is not an advantage of concurrent design?
viva [34]

The answer I believe is B

7 0
3 years ago
Read 2 more answers
You have spent $4,000 on liquor for your bar. Your bar sales have been $24,000. What is your cost of sales for liquor, expressed
amid [387]

Answer:

17%

Explanation:

Given parameters:

Cost price of liquor = $4000

Total sale = $24000

Unknown:

Percentage cost of sale for liquor = ?

Solution:

To find the percentage cost of sale;

       %Cost of sale of liquor = \frac{cost price of liquor}{Total cost of sale }   x 100

Input the variables;

       %Cost of sale of liquor = \frac{4000}{24000}  x 100 = 16.67% = 17%

8 0
3 years ago
What is an example of an Internet access problem?
galina1969 [7]

B.

it's literally common sense

4 0
3 years ago
Read 2 more answers
Other questions:
  • List two ways that guest could be defined
    12·2 answers
  • Should organizations that promote free trade have environmental or social checks and balances?
    14·1 answer
  • Is it just me or is brainly not working right now? I am trying to add friends and it won't let me!
    5·2 answers
  • Who is hurt by piracy
    10·1 answer
  • Why is it important to use random assignment when determining which research participants will comprise the different treatment
    12·1 answer
  • Which of the following is the best example of an installation issue?
    6·2 answers
  • Camera work is at the center of video production. True or False?
    14·1 answer
  • Each student has a record on a file consisting of the following data: Student last name, Student ID (numeric), GPA (a decimal nu
    7·1 answer
  • READ CAREFULLY! There is a difference between moving and copying files.a. Create a directory named . For example, mine would be
    7·1 answer
  • Berat wants to compare images of what the streets of New York City looked like one hundred years ago to now. Which of the follow
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!