CMPS 002 - Computer Literacy

Prof. Paulo Franca

CyberSlug Rules!

Classes

Class Syllabus

Grading Policy

Labs

Interact

Login

  • enter system
  • get attendance
  • submit work
  • take lab quiz
  • check scores

Help

Help me!

Links

Staff only

 

 

 

Datacare   Ahshay

 

Program

  • Problem: to average test scores
  • Questions?
    • what is the input
    • what is the output
  • Abstraction
  • High Level Code (pseudocode)
    • get value
    • sum value
    • average sum
  • First pass of actual code
program averaging;
var
sum : integer;
count : integer;
score : integer;
average : real;
begin
readln (score);
sum := sum + score;
average := sum / count;
end.
 
  • Additional questions
    • How many scores?
    • What type of value is the score?
    • What range of values for score?

      How determine the stopping point?