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

bookChallenge: Pure Function Practice

Tarefa

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.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 2
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

Can you explain this in simpler terms?

What are the main benefits or drawbacks?

Can you give me a real-world example?

close

bookChallenge: Pure Function Practice

Deslize para mostrar o menu

Tarefa

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.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 2
single

single

some-alt