Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Methods Creation | Métodos
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Fundamentos de C#

bookChallenge: Methods Creation

Tarefa

Swipe to start coding

You run a small store. Each order has a fixed price per item and quantity. Your task is to calculate the total price using a separate method.

  • Create a method (CalculateTotalPrice) that:
    • Does not take any parameters.
    • Uses hardcoded values for itemPrice and quantity.
    • Calculates the total price as itemPrice * quantity.
    • Print the result using Console.WriteLine
  • In Main, call this method.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 6. Capítulo 4
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

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

close

bookChallenge: Methods Creation

Deslize para mostrar o menu

Tarefa

Swipe to start coding

You run a small store. Each order has a fixed price per item and quantity. Your task is to calculate the total price using a separate method.

  • Create a method (CalculateTotalPrice) that:
    • Does not take any parameters.
    • Uses hardcoded values for itemPrice and quantity.
    • Calculates the total price as itemPrice * quantity.
    • Print the result using Console.WriteLine
  • In Main, call this method.

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 6. Capítulo 4
single

single

some-alt