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

bookChallenge: for Loop

Aufgabe

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.

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 4. Kapitel 3
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

close

bookChallenge: for Loop

Swipe um das Menü anzuzeigen

Aufgabe

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.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 4. Kapitel 3
single

single

some-alt