Skip to main content

CS118 Programming for Computer Scientists

CS118 15 CATS (7.5 ECTS) Term 1


Core - CS, CSE, CSBS, Discrete Mathematics and Data Science

Academic Aims

This module covers many of the features and techniques needed for computer programming. The first half of the module is structured so that the necessary components of procedural programming are introduced. The concepts covered are applicable to a whole host of different programming languages. Emphasis is placed on writing correct, efficient and maintainable programs. The second half of the module develops on the earlier techniques but with particular application to object oriented programming. The construction of well-designed interfaces, and program encapsulation and abstraction are discussed. The module is based on a number of example programs and emphasis is placed on coursework with the aim of ensuring that the theory covered in lectures is reinforced by practical programming exercises.

Learning Outcomes

At the end of the module, a student will have an understanding of: Data types; Variables, identifiers and scope; Program control structures; Recursion and iteration; Objects and classes; Instance and class definitions; Parameter passing by reference and by value; Array handling; Class inheritance; Error handling; Program design, construction and testing.


Fundamentals of programming

  • Introduction to programming: Programming paradigms; From Specification through Algorithms to Implementation; Program compilation and testing.
  • Building Elements: Preconditions and postconditions; Basic data types; Variables, identifiers and scope.
  • Control structures: Conditionals; Case statements and loops; Correctness issues when programming with loops.
  • Methods: Comparison between iteration and recursion.

Object oriented programming

  • Programming with objects and classes: Complex data types; Parameter passing by reference and by value; Encapsulation.
  • Arrays and strings
  • Class inheritance: Dynamic binding; Multiple inheritance; Interfaces and abstract classes.

Design, construction and testing

  • Program specifications
  • Error handling
  • Methods of testing


  • Daniel Liang Y, Introduction to Java Programming - Comprehensive (7th ed), Pearson, 2008.
  • Cornelius B, Understanding Java, Addison Wesley, 2001.
  • Horstmann CS and Cornel G, Core Java2: Fundamentals (8th ed) Volume 1, Sun Microsystems Press, 2008.


Two-hour examination (60%), 2 programming assignments (40%)


20 lectures and 10 seminars