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Β 7
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Suggested prompts:
Can you explain this in more detail?
What are the main benefits or drawbacks?
Can you give me an example?
Awesome!
Completion rate improved to 1.67
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Β 7
single