CyberSlug Rules!

Beginner Programming CMPS060

Prof. Paulo Franca

Home

Syllabus

Login

Objects

Download

Staff only

Doing better:

Can you see the sequence below is repeated?

grade1=ask("enter a grade");
total=total+grade1;
 

Except for the variable grade1, grade2, grade3... but...

who needs all of those?

use grade (only one variable) as the score of current student!

what do you repeat?

grade=ask("enter a grade");
total=total+grade;