Topics for Test 1 --
Fall 2009
Last modified on Monday, 09-Nov-2009 11:54:48 EST
- Material
- Material from class and web page notes
- From the text: As mentioned in web pages
- Material from first and second assignment
- Overall program structure: write programs reflecting correct structure
- Cardinal rule: define before use
- With and use
- Main procedure
- Declaration section: constants, types,
more constants, procedures, variables
- Nested procedures
- Scope of declarations of variables and other items: know definition of scope and
be able to apply it
- Structured Statements - be able to understand and use them
- if, elsif, end if
- loop: for, while, loop
- exit and exit when
- Exceptions:
- Be able to write an exception handler to handle common exceptions
- Be able to use begin-end blocks appropriately
- Be able to declare and raise exceptions
- Type model
- Define and give examples of a Type (a set of values and set of operations)
- Know and be able to use basic built-in: Integer, Float, Character, Boolean
- Know and be able to use type attributes: First, Last, Range, ... (for numeric and other
types)
- Different types that can be declared: array, enumerated, subtype,
- Strong typing:
- Know definition: compile time and run time checks that verify that
operations are performed only on valid values
- Know where occurs: assignment, parameters, expressions
- Constraint error: Definition and examples
- Type conversions: where, why, and how; implicit/explicit
- Subtypes
- Be able to define and use an Ada subtype
- Subtype conversion:
- Compile time and Runtime actions
- Comparison of in Ada and Java
- Motivation for subtypes
- IO: be able to use basic procedures appropriately
- packages: ada.text_io, ada.integer_text_io
- get(c), get(i), put, put_line
- need proper get and put for the type
- Procedures and functions
- Know terminology - procedure, function, routine, subroutine, method
- Know where can they be declared: main, nested, package
- Be able to write routines using correct declaration syntax: parameters and return type, begin, end
- Parameters:
- Modes: in, out, in out
- Describe semantics and motivation, how to use
- Be able to select best mode
- Communication and returning values via parameters
- Modes and functions
- Local Variables vs global variables: definitions, relation to java locals and fields,
- Arrays
- Declarations and bounds
- Unconstrained: analyze code, use in procedures, know motivation
- Operations
- Assignment
- Equality
- Aggregate assignment
- Slicing
- Attributes
- Enumerated types: how to define and use, motivation, other languages
- Strings: I've decided that these will not be on the exam
- Structure charts: I've decided that these will not be on the exam
THE FOLLOWING TOPICS ARE NOT ON THE FALL 09 EXAM:
- Strings
- Three kinds: fixed, bounded, unbounded
- Tradeoffs
- Compared to java and C
- Implementation of type String:
- Fixed length strings implemented as unconstrained arrays
- Fixed length strings implemented as fixed length arrays
- lengths must match
- length can't change
- Structure charts: sequence, loop, if, information passing, procedures
- Use as a design tool
- Sequence, loop, if, information passing, procedures
- Local Variables vs global variables: problems with globals
- Compiler disambiguates overloaded functions
- Structured Statements - compare them to Java
- Arrays
- Operations
- Type checking: name vs structure
- Multidimensional - comparison with Java
- IO: be able to use basic procedures appropriately
- get_line(s, l)
- look_ahead(c, eol)
- automatic conversion of ints to floats
- problems with global variables
- Ada design goals
- List and define goals and list and explain how various features support the goals
- Three primary design goals
- Supporting reliability and maintainability
- Concern for programmer: Language is small and consistent
- Efficiency (execution speed)
- Side effects: definition, problems, relation to globals
- Parameter mode implementation: Approaches of Ada, Java, C, C++
- Default values, keyword and positional parameters
- Structured Statements - be able to use them and compare them to Java
- case: when others
- loop and a half - write code and describe motivation
- Value vs reference semantics
- Examples
- Benefits
- Primitive vs structured types
- Comparison with Java
- Ada execution model
- Explain and compare with Java: interpreted class files vs
directly executed executable files
- Describe compilation and linking: source, object, and executable files