Challenge: 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
ConvertToFahrenheitthat:- 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.
- Accepts one parameter:
Solution
Everything was clear?
Thanks for your feedback!
Section 6. Chapter 10
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 1.25
Challenge: 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
ConvertToFahrenheitthat:- 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.
- Accepts one parameter:
Solution
Everything was clear?
Thanks for your feedback!
Section 6. Chapter 10
single