Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: for Loop | Bucles
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Fundamentos de C#

bookChallenge: for Loop

Tarea

Swipe to start coding

Imagine you are buying several items in a shop. Each item costs the same amount, and you want to calculate the total cost of all items.

  • Initialize totalCost to 0.
  • The loop should start with i = 0 and run while i < quantity.
  • Add itemPrice to totalCost inside the loop.
  • Return totalCost at the end of the method.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 4. Capítulo 3
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: for Loop

Desliza para mostrar el menú

Tarea

Swipe to start coding

Imagine you are buying several items in a shop. Each item costs the same amount, and you want to calculate the total cost of all items.

  • Initialize totalCost to 0.
  • The loop should start with i = 0 and run while i < quantity.
  • Add itemPrice to totalCost inside the loop.
  • Return totalCost at the end of the method.

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

single

some-alt