Dim total As Single, count As Single, number As Single
Dim text As String
Print "This program will calculate the sum and average for a"
Print "list of numbers. Enter an empty value to end."
Input "Enter a number : ", text
If text = "" Then
count = count + 1
total = total + Val(text)
Print "You entered "; count; " numbers"
Print "The sum is "; total
If count <> 0 Then
Print "The average is "; total / count