COS***
Fundamentals of Programming Languages
AUBG, Computer Science dept, Fall semester 2011
Assoc. Prof. Stoyan Bonev, PhD
Syllabus
Course Annotation: The COS201 FUNDAMENTALS OF PROGRAMMING LANGUAGES course gives basic knowledge to students in the area of programming languages and programming styles. From theoretical point of view various aspects of programming languages are discussed – lexical units (alphabet and vocabulary), syntax (grammar rules) and semantics (the meaning of a program) are introduced. From practical point of view specific programming constructs and components of programming languages are discussed: data classified by category and by type, expressions with operands and operators, assignment statements, selection statements and iterative statements, subroutines, modules and programs.
Programming styles are presented and typical programming languages are used to illustrate those styles:Imperative /Procedure Oriented/ Programming in modern languages like C/C++/C#, Java, Visual Basic and old style languages like Ada, FORTRAN, PL/1, Pascal. Structured Programming principles are introduced. Control structures sequence, selection and repetition are demonstrated. Object-Oriented Programming (OOP) principles are presented. Data encapsulation, inheritance, and polymorphism as typical OOP characteristics are explained;Logic Programming with Prolog;Functional Programming with LISP and dialects.
Students are supposed to have basic knowledge in procedure oriented programming (C/C++ programming languages).
Course Contents: The COS201 FUNDAMENTALS OF PROGRAMMING LANGUAGES course covers lectures, exercises, quizzes and a class project.
The lectures and exercises are of two types: theory and practical. Some of the problems discussed (input data validation, exception handling, OOP) are going to be illustrated using open source demo computer programs. Practical means that students are expected to write their own program version of the problem discussed.
Quizzes are short 15-30 min sessions intending to assess the current student knowledge on specific topics already discussed.
The class project is a more difficult task to solve than those commented during lectures/exercises and includes solution of a concrete problem using Structured Programming techniques and/or Object-Oriented Programming techniques.
Lec/Excise
Basic Topics
L E C T U R E S
Lecture 1
Introduction to Programming Languages.
Corner stones in software development process. Programming styles. Evolution of programming languages. Programming domains. Language evaluation criteria. Influence on Language design. Software life cycle.
Lecture 2
Components of Programming Languages. Part Ia.
Data in Programming Languages. Simple Data Types – Literals, Named Constants and Variables. Data – Fundamental (Basic) data types and Abstract (User Defined) data types.
Lecture 2m
Components of Programming Languages. Part Ib.
Data in Prog Lans. Data Collections – Arrays, Structures, Unions.
Lecture 2mm
Components of Programming Languages. Part Ic.
Data in Prog Langs. Data Structures – Stack, Queue, Deque, Binary Tree.
Lecture 3
Components of Programming Languages. Part II.
Operands. Operators. Expressions. Assignment Operator / Statement.
Lecture 4
Components of Programming Languages. Part III.
Statement-Level Control Structures. Compound Statements. Selection Statements. Iterative Statements.
Lecture 5
Fundamentals of Subprograms.
The subprogram concept: Subroutines (call, return) and Co-routines (resume). Data exchange between subprograms – via parameter passing mechanisms and via global data. Evolution of the subroutine concept.
Lecture 6
Iteration and Recursion in Procedure Oriented Programming.
Basic notions. Syntax representation of iteration and recursion. Examples. Comparison of iterative and recursive algorithms.
Lecture 7
Describing Syntax and Semantics of PL Part I.
Describing specific elements of programming languages (identifiers, keywords, constants, delimiters) as character strings. Syntax diagrams.
Lecture 8
Lexical and Syntax Analysis of PL Part II.
Formal description of PL. Grammars. Backus-Naur Form (BNF) and extended BNF. Syntax diagrams.
Lecture 789
Lexical, Syntax and Semantic aspects of PL Part I&II.
Describing specific elements of programming languages (identifiers, keywords, constants, delimiters) as character strings. Syntax diagrams.
Formal description of PL. Grammars. Backus-Naur Form (BNF) and extended BNF. Syntax diagrams.
Lecture 10
Input Data Validation.
Approaches to test correctness of data entered and processed at run time. Examples.
Lecture 12
Survey on lectures (first half of the semester).
Preparation for the midterm exam.
Lecture 14
Exception Handling in Programming Languages. Part I
Introduction to and Basic Concepts of Exception Handling. Exception handling in typical programming languages.
Lecture 15
Exception Handling in Programming Languages. Part II
Structured EH in Visual Basic. Exceptions and errors with C++ classes.
Lecture 21
OOP. Data Encapsulation.
Introducing the concept of a class as a collection of data elements and member functions (methods). Classes as user defined types. The relation class – object.
Lecture 22
OOP. Inheritance.
Base classes and derived classes. Access control. Class hierarchies. Multiple inheritance.
Lecture 23
OOP. Polymorphism.
Early binding and late binding. Normal member functions and virtual member functions accessed via pointers. Friend functions.
Lecture 24
OOP. Data Conversion.
Assignment operator and data conversion between the same data types, between basic types, between user defined types and basic types, between objects of different classes.
Lecture 25
OOP. Parameterized Abstract (User Defined) Data Types.
The C++ template reserved word. Generic functions. Generic classes.
Lecture 26
OOP. Class Libraries for General Purpose Programming Elements.
Borland Container class library CCL. Microsoft Foundation library of classes MFC. Standard Template library of classes STL. Examples.
Lecture 27
OOP. Iteration Based on Data Structures.
Introducing the concept of iterating through the structure’s elements. Internal iterator. External iterator.
Lecture 28
OOP. Standard Template Library.
Introducing the general library concept.
Lecture 28a
OOP. Standard Template Library.
Containers.
Lecture 28b
OOP. Standard Template Library.
Algorithms.
Lecture 28c
OOP. Standard Template Library.
Iterators.
Lecture 29
OOP. Streams and Files.
Introducing the File I/O Processing.
Lecture 36
OOP. The .NET Base Class Libraries to build Windows Applications.
Lecture 51
Programming Styles. Logic Programming.
Basic elements of Prolog. Facts statements. Rules statements. The inferencing process of Prolog (satisfying, re-satisfying, backtracking).
Lecture 52
Programming Styles. Functional Programming.
Basic principles of FP. The LISP machine infinite loop: Read, Evaluate, Write. Describing user defined names and functions.
Lecture 61
Survey
Survey on lectures.
Preparation for the final exam.
E X E R C I S E S
Exercise 2a
Data.
Simple data types and Data Collections.
Exercise 5a
Fundamentals of Subprograms.
Build and test functions that illustrate: parameter passing mechanisms, overloaded functions, default arguments functions, in-line functions.
Exercise 6a
Iteration and Recursion in Procedure Oriented Programming.
Build and test implementation of certain iterative and recursive algorithms.
Exercise 30a
OOP. Data Conversion.
Exercise 14a
Exception Handling in Programming Languages.
Build and test a set of programs to illustrate the Exception Handling.
Q U I Z Z E S
Quiz 1
Components of Programming Languages
Quiz 2
Routines, Iteration and Recursion
Quiz 3
Object Oriented Programming
Quiz 4
Exception Handling Techniques
References:
Recommended textbooks:Sebesta R., Concepts of Programming Languages, IE Pearson Education, Addison Wesley Publ. Com., 9e, 2010.Louden K.C., K.A.Lambert, Programming Languages, Principles and Practice, 5e, IE, Course Technology, Cengage Learning, 2012.Lafore R., Object-Oriented Programming in C++, SAMS Publ. 4e, 2002.Friedman F., E.Koffman, Problem Solving, Abstraction and Design Using C++, IE Pearson Education, Addison Wesley Publ. Com., 5e. 2007.Gregory K., Microsoft Visual C++ .NET 2003, SAMS, 2004.
Other useful books:Flanagan D., JAVA in a Nutschell, 5th ed.,O’Reilly & Associates, 2005.Gosselin D., JavaScript, 5th ed., IE, Course Technology, Cengage Learning, 2011
Grading: Final exam: 30% Midterm exam: 30%
Class project: 26% Quizzes: 14% (4x3.5)
The students will get a score in the range 0-100 for each of the components. The total score (computed with the above coefficients) will be used to form the final grade:
A–, A (excellent) cover scores 90-100 90- - - - - - - - - -96 96-100
B–, B, B+ (good) cover scores **-**-**-**-**-** 86-90
C–, C, C+ (average) cover scores **-**-**-**-**-** 76-80
D, D+ (poor) cover scores 60-70 60- - - - - - - - - -66 66-70
Scores below 60 mean failure. + and – will be used for distinguishing the results in a given level. Activity in a class will be treated as a bonus.
Attendance:Students are expected to attend all classes (lectures and exercises).An attendance register will be taken at each class.Students who miss three classes will be dropped from the course.Mobile phones ringing in class disturb the whole class. Please switch off your mobile phone before each class.
Academic honesty:
Students are expected to demonstrate an academic behavior in full capacity of the term.
Lectures/Exercises Hours: COS201, Wed 10:45-12:00, Fri 09:00-10:15
Lectures Place: COS lab, MB 120
Office Hours: see list on office door
Lecturer: Assoc. Prof. Stoyan Bonev, PhD
Office: 243 Tel.: (ext.): 419 e-mail: ******@****.**
COS201
Fundamentals of Prog Lan
Fall 2011
Course Outline – Sequence of Classes
Remark: This syllabus is subject to modification. The instructor will communicate with students on any changes such as in the schedule or the assignments.
Week No
Wednesday
Friday
Lec 1
Intro to PL
Lec 1
Intro to PL
Lec 2
Simple Data Types
Lec 2m
Array etc
Lec 2mm
Stack, Btree etc
Lec 10 IDV
Lec 27
Foreach
Midterm overview,
Mid term exam
Class Projects
Lec 21
OOP1 Data Encapsulation
Lec 22
OOP2 Inheritance
Lec 23
OOP3 Polymorphism
Lec 23m
OOP3m OpOvld, Friends
Lec 23mm (Ex23a)
OOP Practical Session
Quiz 3
Break week Break week Break week
10
Lec 24
OOP4 Data Conversion
Lec 30,36
WinBased Aplications
11
Lec 25
Generic Classes
Lec 26
Class Libraries CCL/MFC/STL
12
Lec 14 / Ex 14a
Exceptions 1
Lec 15
Exceptions 2
Quiz 4
13
Lec 51
LogicProg
Lec 52
FunctProg
14
Class Project
Presentation (1 10)
Class Project
Presentation (11 20)