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
Write a method isMultiple that determines, for a pair of integers, whether the second integer is a multiple of the first. The me
NNADVOKAT [17]
I don't know what language you want it in but I will write this in Java.

public int isMultiple(int x, int y) {
    if (x % y == 0)
        return 1;
    return 0;
}

The mod function (%) returns 0 iff x divides y.
Feel free to ask me questions!
3 0
3 years ago
Read 2 more answers
You must create ____ before any of the other database objects.
hram777 [196]
You must create -tables- before any of the other database objects.
5 0
3 years ago
The basic building blocks of java is known as<br><br><br><br>Reply fast! plzzzzzzzzzzz!!!
Nadya [2.5K]

Answer:

A class is the basic building block in Java.

8 0
2 years ago
Write the definition of a function named count that reads all the strings remaining to be read in standard input and returns the
spayn [35]

Answer:

The function written in C++

int str(string word) {

int count = 1;

for(int i =0; i<word.length();i++) {

 if(word[i] == ' ') {

  count++;

 }

}

return count;

}

Explanation:

This line defines the function

int str(string word) {

This line initializes count to 1

int count = 1;

This line iterates through the input string

for(int i =0; i<word.length();i++) {

This line checks for blank space

 if(word[i] == ' ') {

Variable count is incremented to indicate a word count

  count++;

 }

}

return count;

}

<em>See attachment for full program</em>

Download cpp
8 0
2 years ago
Exercise 1-12 <br> This information is for Windsor, Inc. For the year ended December 31, 2017
Agata [3.3K]

Answer:

Please check the attachment.

Explanation:

Net change in cash, is the net increase in the cash from previous year which is 11900 here, and since the cash in hand is 17200, the net increment is 17200-11900 = 5300 from past year.

And the Cash forecast depends upon cash in hand, and which is 17200, and this is while disregarding future profit.

Rest of the details are in the file attached.

Download xlsx
8 0
2 years ago
Other questions:
  • Given that it takes 0.08 ms to travel from one track to the next of a hard drive; that the arm is originally positioned at Track
    6·1 answer
  • To clear a filter, click the ____ button on the home tab and then click clear all filters.
    15·1 answer
  • Write an application that reads the lengths of the sides of a triangle from the user. compute the area of the triangle using her
    11·1 answer
  • What are the data types in access​
    6·1 answer
  • etwork behavior analysis system __________ sensors are typically intended for network perimeter use, so they are deployed in clo
    10·1 answer
  • FILL IN THE BLANK
    7·1 answer
  • PLZ HELP IM IN A HURRY Select all that apply.
    9·1 answer
  • What problems do you see in the process of transacting business online
    10·1 answer
  • 4. Contoso, Ltd. has a vigorous Office 365 and Azure cloud-service presence.
    8·1 answer
  • What color pixels are used in a camera?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!