Module MA1264: Introduction to programming in C/C++"
Credit weighting (ECTS)
5 credits
Semester/term taught
Hilary term 2016-17
Contact Hours
11 weeks at 3 hours lecture + 1 hour lab per week Course web page, including lecture notes: www.maths.tcd.ie/~odunlain/1264
Lecturer
Prof. Colm Ó Dúnlaing
Learning Outcomes
On successful completion of this module students will have;
Ability to write simple C/C++ programs quickly.
Familiarity with computer representation of data.
Ability to simulate simple routines, recursive or otherwise.
Greater productivity through the C++ Standard template and Armadillo libraries.
Module Content
Hexadecimal numbers, machine code, assembler code, languages, C and C++.
Basic data types char, short, int, long, float, double, pointer, arrays.
Integer arithmetic.
Variables.
Assignment statements.
Arrays and initialisation.
For-loops and output.
While-loops.
Command-line arguments.
Input through scanf() and fgets() and >>.
If-statements.
Functions and subroutines.
Simulating functions and subroutines.
2-dimensional arrays.
Type conversion, unsigned types, sign extension.
C string library.
Pointers, Malloc() and Calloc()
Structured types in C and C++
Classes in C++
C++ Standard Template Library (STL)
C++ armadillo linear algebra library.
The 'cut-and-paste principle'.
Module Prerequisite
Assessment Detail
This module will be examined in a 2 hour exam in Trinity term. 20% of the final mark will be based on course work, (10% programming assignments & 10% quizzes) and the other 80% on the exam.