| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Procedures - Exercise 1 - Solution

Page history last edited by Steve Sweeney 15 years ago

procedure printBar ( symbol : string, repetitions : int ) 

    for count : 1 .. repetitions

        put symbol ..   % on the same line 

    end for 

    put ""  % add a return at the end of the line 

end printBar

%%%%%%%%%%%%%% Main Program %%%%%%%%%%%%%%%%%%

var symbol : string

var repetitions : int

put "What symbol would you like to output? " ..

get symbol

 

put "How many times do you want to repeat the symbol? " ..

get repetitions

printBar ( symbol, repetitions )

Comments (0)

You don't have permission to comment on this page.