








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Loops, Unconditional infinite loop, While and For Loops, Exit statement, Block Statement, Declaring and Handling Exceptions, Exception Handling, Subprograms, Nesting of subprograms are key points of this lecture. Programming languages is basic subject of computer science. Its not about any specific language but almost cover all of them.
Typology: Slides
1 / 14
This page cannot be seen from the preview
Don't miss anything!
loop -- Loop body goes here end loop ;
loop -- Loop body goes here if condition then exit ; end if ; end loop ;
loop -- Loop body goes here exit when condition ; end loop ;
Outer : loop Inner : loop … exit Inner when Done; end loop Inner; end loop Outer;
declare -- declare section optional declarations begin statements exception -- exception section optional handlers end ;
begin statements exception when exception1 => statements ; when exception2 => statements ; end ;
Procedure My_procedure(x, y : IN OUT integer) is … function aux_func(a : Integer) return integer is Temp : float; begin … return integer(temp) * a; -- retrun temp * a is not allowed end aux_func; … begin … aux_func(x); … end My_procedure;
Type Name No return type
Parameter List – IN, OUT, IN OUT
Default mode is ‘IN’
You have to convert/cast^ Return type ‘Temp’ to an integer
package STACK is procedure PUSH (x : INTEGER); function POP return INTEGER; end STACK;
package body STACK isMAX: constant := 100; S : array (1..MAX) of INTEGER;TOP : INTEGER range 0..MAX; procedure PUSH (x : INTEGER) isbegin TOP := TOP + 1;S(TOP) := x; end PUSH; function POP return integer isTOP := TOP - 1; end POP;return S(TOP + 1); begin TOP := 0; end STACK;
exception is raised and need^ If value of TOP>100, an to be handled