Complete the challenge to convert Fahrenheit to Celsius

In this challenge, you’ll write code that will use a formula to convert a temperature from degrees Fahrenheit to Celsius. You’ll print the result in a formatted message to the user.

Challenge: Calculate Celsius given the current temperature in Fahrenheit

  1. Select all of the code in the .NET Editor, and press Delete or Backspace to delete it.
  2. Enter the following code in the .NET Editor:C#Copyint fahrenheit = 94;
  3. To convert temperatures in degrees Fahrenheit to Celsius, first subtract 32, then multiply by five ninths (5 / 9).
  4. Display the result of the temperature conversion in a formatted messageCombine the variables with literal strings passed into a series of Console.WriteLine() commands to form the complete message.
  5. When you’re finished, the message should resemble the following output:OutputCopyThe temperature is 34.444444444444444444444444447 Celsius.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *