Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: do-while Loop | Boucles
Bases de C#

bookChallenge: do-while Loop

Tâche

Swipe to start coding

In this task, you will practice using a do-while loop to simulate a real-life scenario: saving money daily until reaching a target amount.

  • Inside the CalculateSavings method:
    • Initialize totalSaved to 0.
    • Initialize days to 0.
    • Use a do-while loop to:
      • Add dailySaving to totalSaved each day.
      • Increment days by 1.
      • Repeat the loop until totalSaved is greater than or equal to targetAmount.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 4. Chapitre 7
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

bookChallenge: do-while Loop

Glissez pour afficher le menu

Tâche

Swipe to start coding

In this task, you will practice using a do-while loop to simulate a real-life scenario: saving money daily until reaching a target amount.

  • Inside the CalculateSavings method:
    • Initialize totalSaved to 0.
    • Initialize days to 0.
    • Use a do-while loop to:
      • Add dailySaving to totalSaved each day.
      • Increment days by 1.
      • Repeat the loop until totalSaved is greater than or equal to targetAmount.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 4. Chapitre 7
single

single

some-alt