Sektion 6. Kapitel 7
single
Challenge: Return Values
Stryg for at vise menuen
Opgave
Stryg for at begynde at kode
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 alt klart?
Tak for dine kommentarer!
Sektion 6. Kapitel 7
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat