Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Multi-Dimensional Arrays | Arrayer
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
C#-Grunnleggende

book Challenge: Multi-Dimensional Arrays

Oppgave

Swipe to start coding

A classroom has several rows of students, and each student has a score. You need to calculate the total score for each row using a method that accepts a 2D array.

  • Use array.GetLength(0) to get the number of rows.
  • Use array.GetLength(1) to get the number of columns.
  • Initialize a variable rowTotal = 0 for each row before summing.
  • Use rowTotal += scores[row, col] to add each student's score.
  • Print the row total using Console.WriteLine.

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 5. Kapittel 4
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

book Challenge: Multi-Dimensional Arrays

Sveip for å vise menyen

Oppgave

Swipe to start coding

A classroom has several rows of students, and each student has a score. You need to calculate the total score for each row using a method that accepts a 2D array.

  • Use array.GetLength(0) to get the number of rows.
  • Use array.GetLength(1) to get the number of columns.
  • Initialize a variable rowTotal = 0 for each row before summing.
  • Use rowTotal += scores[row, col] to add each student's score.
  • Print the row total using Console.WriteLine.

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 5. Kapittel 4
single

single

some-alt