12. Write(‘ Do you want to delete the file? (Y or N) ’); Read(answer); IF answer = ‘Y’ THEN writeln (‘Deleting file’ ) ELSE writeln (‘File NOT deleted’);
22. procedure GoPassword; // SUB PROGRAM var password : string; Begin WHILE password <> 'open' Do begin Writeln('Enter your password'); read(password); IF password = 'open'THEN Writeln( 'Welcome to the FBI''s secret computer network') ELSE Writeln('TRY AGAIN'); end; end; BEGIN // MAIN PROGRAM GoPassword; readln; END.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32. Dividing programs into objects The basic idea behind objects is that instead of making physical (duplicate) copies of subprograms, you maintain a single, physical copy of subprograms but allow others to make “virtual” copies of those subprograms,