Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Return Values | Methods
C# Basics

bookChallenge: Return Values

Task

Swipe to start coding

Your task is to create a method that takes a Celsius value, converts it to Fahrenheit, and returns it.

  • Create a method ConvertToFahrenheit that:
    • Accepts one parameter:
      • celsius (double)
    • Converts the Celsius temperature to Fahrenheit using the formula: Fahrenheit = Celsius * 9 / 5 + 32
    • Returns the Fahrenheit value as a double.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 6. ChapterΒ 7
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

bookChallenge: Return Values

Swipe to show menu

Task

Swipe to start coding

Your task is to create a method that takes a Celsius value, converts it to Fahrenheit, and returns it.

  • Create a method ConvertToFahrenheit that:
    • Accepts one parameter:
      • celsius (double)
    • Converts the Celsius temperature to Fahrenheit using the formula: Fahrenheit = Celsius * 9 / 5 + 32
    • Returns the Fahrenheit value as a double.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 6. ChapterΒ 7
single

single

some-alt