CyberSlug Rules!

Beginner Programming CMPS060

Prof. Paulo Franca

Home

Syllabus

Login

Objects

Download

Staff only

Example:

a program to read the scores of 10 students and compute the average.

Notice that:

  • how do you compute the average?
  • there are ten students
  • for each student you have to read the score and accumulate.

what do I repeat?

what do I change?

when do I stop?

how does the loop begin?

Got it? using a while loop; using do/while; using a for loop.