
-----------------------------------
worschtl
Thu Mar 22, 2007 1:16 pm

Student mark's program - need help
-----------------------------------
Hello!

For Grade 11 Computerengineering I have to complete the attached assignment. I' ve been desperately trying to do so, but still couldn't figure it out myself. The reason why is probably that I didn't take Grade 10. Still, my teacher is not willing to help me  :cry: ... hopefully you guys will, that would just be awsome!

This is what I' ve got so far:


procedure clearScreen
    var ch : string (1)
    put "Press ENTER to clear the screen and continue."
    getch (ch)
    cls
end clearScreen

var marks : array 1 .. 6, 1 .. 50 of int    %stores the student's marks
var studentnumber : string                  %The studentnumber
var mark : string                           %
var nomark : string
var Test : boolean
var flag : string
var test : string
var num : int
var num1 : int
var num2 : int
var upper_bounds : string


flag := "continue"

loop
    put "Please enter a seven digit student number. Type in 9999999 to quit."
    get studentnumber                                                           %gets the studentnumber
    if studentnumber = "9999999" then                                           %leaves the loop when the studennumber is 9999999
        flag := "Exit"
        if flag = "Exit"
                then
            exit
        end if
    end if

    Test := strintok (studentnumber)                                            %checks the input
    if Test then
        num := strint (studentnumber)
    else
        put studentnumber, " is not a valid student number."
    end if
    if Test then
        if length (studentnumber) < 7 then
            put "The student number must be 7 digits long. Type 0's in the beginning if necessary"
        elsif length (studentnumber) > 7 then
            put "The student number must be 7 digits long. Type 0's in the beginning if necessary"
        elsif length (studentnumber) = 7 then
            exit when num > 0
            if num = 1 and num1  6 then
            put "You must enter a number between 1 to 6."
        end if
    else
        put upper_bounds, " is not a valid integer."
    end if
end loop
loop
    for i: 1..num1
    if studentnumber = "9999999" then                                    %leaves the loop when the studennumber is 9999999
        flag := "Exit"
        if flag = "Exit"
                then
            exit
        end if
    end if
    put "Please enter the test ", i ," mark for student ", studentnumber, " as a number between 1 to 100."
    get mark                                                             %gets the student's mark
    if strintok (mark) = true then                                       %checks the input
        num2 := strint (mark)
        if num2 < 0 or num2 > 100 then
            put "Your value of ", mark, " was not between 0 to 100."
        end if
        if num2 >= 0 or num2 