Computer Science Canada

How do I find the highest mark in the numbers that user enters (loop)

Author:  rposh00 [ Sun Jan 24, 2016 4:36 pm ]
Post subject:  How do I find the highest mark in the numbers that user enters (loop)

What is the problem you are having?
I need to know how to display the highest mark/number

Turing:


var mark, sum, average : real
var students : int
sum := 0
students := 0
put "Enter all the marks then to finish, enter a negative number. (negative numbers wont be counted."
put ""
loop
    get mark
    exit when mark < 0
    sum := sum + mark
    students := students + 1
end loop
put ""
put "The sum of all the marks is : ", sum
average := sum / students
put "The class average is : ", average




Please specify what version of Turing you are using
<4.1.1>

Author:  Insectoid [ Sun Jan 24, 2016 5:44 pm ]
Post subject:  RE:How do I find the highest mark in the numbers that user enters (loop)

Please don't bump posts. There is no need for it. It won't make us help you any faster and might just annoy us enough not to help at all.

What have you tried so far?


: