Page 1 :
CHAPTER - 8, , , , V/COMP/12, , MSWLOGO PROCEDURES, , MSWLogo Procedure: MSWLogo Procedure is a series of saved MSWLogo, commands designed to achieve a specific objectives., , Difference between MSWLogo Primitive and MSWLogo Procedure:, MSWLogo Primitive is a command built into MSWLogo whereas, , MSWLogo Procedure is a set of commands that the user defines in the, computer memory., , Parts of MSWLogo Procedure:, It has three parts namely : Title, Body and End., , Title :, , Body:, End:, , The title section begins with TO , followed by the procedure, name. The procedure name must be separated from the, command word TO at least one space. A procedure name may, be made up of any combination of letters, numbers or special, characters leaving aside the operators. The name of the, procedure should be a single word., , Example: TO TRIANGLE, , The body is the set of commands of the program., , It is the end of a procedure., , Creating a procedure to draw a triangle( Step by step):, Follow the steps —, (i) Type TO TRIANGLE in commander and press ENTER., Now the TO Mode window opens., (ii) In TO Mode, type or input the following command., , REPEAT 3 [FD 60 RT 120], , and press OK., (iii) Press CANCEL in TO Mode to END the procedure., , Now TRIANGLE defined will be shown in the commander window., Thus we create a Procedure to draw a triangle., EXECUTING A PROCEDURE, , Even as the procedure ends and gets defined, the triangle is not drawn., , The triangle will be drawn typing the name of the procedure e.g., TRIANGLE , and press execute.
Page 2 :
V/COMP/12, , SAVING A PROCEDURE, , To save a procedure, follow the steps,, , (i) Select File > Save, , (ii) The Save As dialog box is displayed., , (iii) | Typea filename in the File name box and click Save., , LOADING A PROCEDUE:, , The saved procedures can be loaded in the computer memory and used, again. To load the procedure file, follow the steps —, (i) Select File > Load., , (ii) The Open dialog appears., (iii) Click the file name in the file list and click Open., , (iv) The procedure file is loaded into the computer memory. We can, type the procedure name to execute it., , EDITING PROCEDURE FILE:, , To edit a procedure file, follow the steps —, , (1) Select File > Load., , (2) Choose the procedure file to open., , (3) Click Edall button and editor window. The saved procedures will be, displayed., , (4) We can edit the procedure now and select File > Save and Exit., , TEXTUAL EXERCISE QUESTIONS:, , 1., , State True (T) or False (F):, , (a) The name of the procedure has to be a double word. _—_(F), , (b) While you execute any defined procedure, you are in saving mode.(T), , (c) Procedure defined message is displayed in commander window. (T), , (d) For editing the loaded procedure file, click File > Edit. (F), , (e) Toend a procedure after typing in the commands, type END, command. (T), , Fill in the blanks:, , (a) On typing the TO command, the TO Mode window appears., , (b) You cannot use operators to name a procedure., , (c) To edit a procedure, click Edail button., , (d) For editing a procedure, it has to be /oaded in the computer memory., , (e) Save command transfers the content of the file to the computer, memory.
Page 3 :
V/COMP/12, , Answer the following questions:, , (a), Ans:, , (b), Ans:, , (c), Ans:, , (d), , Ans:, , (e), Ans:, , What is an MSWLogo Procedure ?, MSWLogo Procedure is a series of saved MSWLogo commands, designed to achieve a specific objectives., Differentiate between a Primitive and a Procedure., MSWLogo Primitive is a command built into MSWLogo whereas, MSWLogo Procedure is a set of commands that the user defines in, the computer memory., Create two procedures to draw a circle and a rectangle., Procedure to draw a circle:, TO CIRCLE, REPEAT 360 [ FD 2 RT 1], END, Procedure to draw a rectangle:, TO RECTANGLE, REPEAT 4 [ FD 50 RT 90], END, Write the steps to save a Procedure., To save a procedure, follow the steps,, (i) Select File > Save, (ii) The Save As dialog box is displayed., Type a filename in the File name box and click Save., Explain the Editing of Procedure Files with example., To edit a procedure file of RECTANGLE, follow the steps —, (1) Select File > Load., (2) Choose the procedure file RECTANGLE to open., (3) Click Edall button and editor window. The saved procedures, will be displayed as, REPEAT 4 [ FD 50 RT 90], (4) Wecan edit the procedure now to make a bigger rectangle of, side length 70 units instead of 50 units., REPEAT 4 [ FD 70 RT 90], (5) Select File > Save and Exit., , kk, , ae