Avsnitt 6. Kapitel 7
single
Challenge: Return Values
Svep för att visa menyn
Uppgift
Svep för att börja koda
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:
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 6. Kapitel 7
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal