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
Why did the boy run from the pillow...... wrong answers only
Savatey [412]

He thinks there is a demon hiding innit thus, he runs and calls his mom. His mom says "Jimmy there's nothing in that pilow young man!" Jimmy walks back to his room scared if its still there. He hops into bed hoping that he can get a good nights rest. The next day, Jimmy asks if he can go buy another pillow. His mom says "As long as it makes you feel safe then ok." Young Jimmy, jumping in excitement, goes to the checkout zone to buy his new pillow. When they get home, Jimmy and his mom eat dinner and then head for bed. Jimmy hops into bed and knows that everything will be ok. The end.

4 0
2 years ago
Name the character encoding standard that enables up to 128 different commonly used characters,
Lelechka [254]

Answer:

ASCII character set.

Explanation:

ASCII is an acronym for American Standard Code for Information Interchange and it was developed from a telegraph code. It is typically a character encoding standard that comprises of seven-bit (7-bit) set of codes.

ASCII character set is the character encoding standard that enables up to 128 different commonly used characters, numbers and symbols to be used in electronic communication systems. The ASCII character set is only used for encoding English language and it comprises of both the lower case and upper case letters of the 26 alphabets, number 0 to 9 and symbols.

8 0
2 years ago
What can you say about the different website that you used? do they have in common?​
Harrizon [31]
They all have ads. Some have inappropriate ads while some have irrelevant ads with respect to the website your on.
8 0
2 years ago
What is the simplest way to permanently get rid of an unwanted file? A. Go to the Start menu and then delete the file. B. Erase
vazorg [7]

C. Send it to the recycle bin and empty the recycle bin
7 0
3 years ago
One of the jobs of the webmaster are to create a website<br>true or false
Talja [164]

true is the correct answer

8 0
3 years ago
Read 2 more answers
Other questions:
  • What keyboard shortcut keys selects cell A1
    12·1 answer
  • A ____ instruction copies data bits to storage locations and can copy data between any combination of registers and primary stor
    11·1 answer
  • Each time you save a document, _____. you will need to type in the file type in which it should be saved you can select the Save
    11·1 answer
  • Which of the following is true regarding packaged software and custom software? Group of answer choices Packaged software are ap
    13·1 answer
  • Similarites between hardware and software
    9·1 answer
  • What maintains data about various types of objects, events, people, and places?
    10·1 answer
  • write the files used on QBASIC (If u will answer right answer I will follow U and U will got 40 points)​
    7·1 answer
  • If you walked into a room containing three computers and were told one of them was infected with malware, how would you determin
    10·1 answer
  • If you anticipate running a particular query often, you can improve overall performance by saving the query in a special file ca
    11·1 answer
  • In additon to setting up services, what other tasks does a sysadmin have to keep in mind? check all that apply.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!