Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Utility Class for Temperature Conversion | Static Classes and Members
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
C# OOP Class Construction Drills

bookChallenge: Utility Class for Temperature Conversion

Tarea

Swipe to start coding

Create a static utility class named TemperatureConverter for temperature conversion. You must implement two static methods with the exact names:

  • CelsiusToFahrenheit: takes a Celsius temperature (double) and returns the corresponding Fahrenheit value (double). Use the formula: (celsius * 9 / 5) + 32.

  • FahrenheitToCelsius: takes a Fahrenheit temperature (double) and returns the corresponding Celsius value (double). Use the formula: (fahrenheit - 32) * 5 / 9.

  • The class must be declared as static.

  • Both methods must be declared as static and use the exact method names provided.

  • Both methods must be accessible directly from the class without creating an instance.

  • Ensure you use the provided formulas for each conversion.

  • Do not change the method names or class name.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 2
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

Suggested prompts:

Can you explain this in simpler terms?

What are the main takeaways from this?

Can you provide an example to illustrate this?

close

bookChallenge: Utility Class for Temperature Conversion

Desliza para mostrar el menú

Tarea

Swipe to start coding

Create a static utility class named TemperatureConverter for temperature conversion. You must implement two static methods with the exact names:

  • CelsiusToFahrenheit: takes a Celsius temperature (double) and returns the corresponding Fahrenheit value (double). Use the formula: (celsius * 9 / 5) + 32.

  • FahrenheitToCelsius: takes a Fahrenheit temperature (double) and returns the corresponding Celsius value (double). Use the formula: (fahrenheit - 32) * 5 / 9.

  • The class must be declared as static.

  • Both methods must be declared as static and use the exact method names provided.

  • Both methods must be accessible directly from the class without creating an instance.

  • Ensure you use the provided formulas for each conversion.

  • Do not change the method names or class name.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 2
single

single

some-alt