Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Scopes | Métodos
Fundamentos de C#

bookChallenge: Scopes

Tarefa

Swipe to start coding

You want to calculate total sales for a day using local and global variables.

  • Declare a global variable grandTotal (outside any method) to store the total sales.
  • Create a method AddSale that:
    • Declares local variables price and quantity.
    • Calculates the total for that sale and adds it to the global grandTotal.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 6. Capítulo 12
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: Scopes

Deslize para mostrar o menu

Tarefa

Swipe to start coding

You want to calculate total sales for a day using local and global variables.

  • Declare a global variable grandTotal (outside any method) to store the total sales.
  • Create a method AddSale that:
    • Declares local variables price and quantity.
    • Calculates the total for that sale and adds it to the global grandTotal.

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 12
single

single

some-alt