Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: do-while Loop | Løkker
C#-Grunnleggende

bookChallenge: do-while Loop

Oppgave

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.

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 4. Kapittel 7
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

close

bookChallenge: do-while Loop

Sveip for å vise menyen

Oppgave

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.

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 4. Kapittel 7
single

single

some-alt