IPT - A Virtual Approach IPT A Virtual Approach by Peter Whitehouse
Quick Links:
 
 
Information and Intelligent Systems Social and Ethical Implications Human Computer Interaction Software and Systems Engineering eXercise Files Course Outline and Assessment A-Z of Geeky Acronyms Terrace Work Program 2004 Sillybus FAQ = Frequently Asked Questions Help
 
 

eXercise #1

Introducing Pascal Syntax

  1. Which of the following would NOT be acceptable as identifiers (if not, why not):

    1. last
    2. end
    3. 3rd_name
    4. the radius
    5. interger
    6. $1.00
    7. b/2a
    8. whyNot?
    9. <length>
    10. a_long____andPointlessName
    11. begin
    12. ten%

  2. Given the following fictitious syntax definition:
    a thingo is defined as: letter digit [digit {digit|underscore}]
    1. Determine whether the following thingos are legal
      1. e4
      2. DD1_4_3
      3. U2222_222
      4. T66
    2. Write 3 different legal thingos by yourself


  3. Referring to the following unit:
    Procedure TForm1.button1click(sender:TObject);
    
    {this is my first real program
    var x = real, y=interger;
    
    begin
    x = 2.5;
    y = square[x]
    showmessage('x = ' + strtoint(x));
    outputbox('y = ' + y)
    end
    
    Re-write it so that it is free of LOGICAL and SYNTAX ERRORS


  4. Distinguish between a LOGICAL and a Syntax error - give an example of each to clearly show you know the difference


  5. Explain, briefly, the difference between COMPILED languages and INTERPRETED languages.


  6. Delphi/Pascal is said to be a THIRD GENERATION language - what are the other generations (with examples) and describe briefly how the generations differ.

Solutions

wonko@wonko.info
©Copyright t 1992..2018+. Edition 26.150117
wonkosite
Creative Commons License
This work is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 2.1 Australia License
.