Wednesday, November 17, 2010

DESK CHECK!!!!

        Today we desk checked our repetition assignment 7:

% declaration section
var mark : real
var mean : real
var number_of_marks : int
var total_marks : real
var user_choice : char

% initialization section
number_of_marks := 0
total_marks := 0

% input, processing, and output section
loop
    put "Mark: " ..
    get mark

    number_of_marks := number_of_marks + 1
    total_marks := total_marks + mark
    put "You have input ", number_of_marks, " marks."
    put "Would you like to enter more marks? (y/n)" ..
    get user_choice

    exit when user_choice = "n"
end loop
mean := total_marks / number_of_marks
% extro section
put skip, "The mean of the mark(s) is ", mean, "."

Before that, though, we got back the assignments we handed in last class. We then took our desk-checked assignments and polished them up on Turing.

        For homework, I need to finish science, so I'm going to skip badminton club. I need to finish the As-tu compris for French, textbook page 70.

No comments:

Post a Comment