Algorithm in Visual Basic (1 Viewer)

fan96

617 pages
Joined
May 25, 2017
Messages
543
Location
NSW
Gender
Male
HSC
2018
Uni Grad
2024
your pseudocode is logically correct (if you intended the "count+1" to be outside of the IF statement) but you have some syntax errors.
Code:
BEGIN
    count = 0
    present = 0
    GET advent
    WHILE advent has not ended
        IF advent[count] = "Present" THEN
            present = present + 1
        ENDIF
        count = count + 1
    ENDWHILE
END
as for the actual code you'll need to know the structure of the text file (i.e. how exactly the presents are stored) in order to successfully write the program.
 

nakappe

New Member
Joined
Jan 24, 2019
Messages
16
Gender
Undisclosed
HSC
2019
Thank you for your reply. What do you mean by "You'll need to know the structure of the text file"??
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top