Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Pure Function Practice | Pure vs Impure Functions & Stepwise Decomposition
C# Methods & Modular Thinking

bookChallenge: Pure Function Practice

Tarea

Swipe to start coding

Write a method that calculates the factorial of a given integer in a pure manner. The function must not cause any side effects and should only depend on its input.

  • Return the correct factorial value for non-negative integer input.
  • Throw an ArgumentException if the input is negative.
  • Ensure the method does not read from or modify any external state.

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

close

bookChallenge: Pure Function Practice

Desliza para mostrar el menú

Tarea

Swipe to start coding

Write a method that calculates the factorial of a given integer in a pure manner. The function must not cause any side effects and should only depend on its input.

  • Return the correct factorial value for non-negative integer input.
  • Throw an ArgumentException if the input is negative.
  • Ensure the method does not read from or modify any external state.

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