This course provides a gradual but in-depth introduction to imperative programming using the C programming language. It is intended for students who are not taking Computer Science/Artificial Intelligence as part of their degree. Our lectures (2 a week) are backed up with a scripted (and supervised) two-hour Lab and a one-hour tutorial, every week. The assessment will be based on a 3-hour online programming exam in December (worth 90%) and one coursework due in week 9 (10%).
The Year Organizer is Paul Anderson.
The class reps for 2016/17 are on this restricted page.
CP is taught in semester 1. It is taught as a combination of two Lectures:
We are not currently maintaining the list of Lab allocations, as we have enough space for students to turn up to whichever lab suits them.
It also includes a 1-hour Tutorial (from week 3 onwards).
You should be able to see your tutorial allocation on your Informatics student page, and also change it (if there are any vacancies). Tutorial allocations are also listed at this page.
In case of problems, contact the ITO (see above), not the course organizer
Some students report security warnings when they try to access this link. This is because the University certifies its own secure pages, rather than using a commercial provider. Most Internet browsers will offer an link to bypass the security-warning, if you look closely. If you really can't see a way to do that, try a different browser (eg switch from Explorer and try with Chrome instead). You will see this problem with all University secure sites if you access them from a private machine, so it's worth installing the University's certificate in your browser. For instructions on this, see Information Services' page.
You can change your Tutorial allocation (if there is room) at student.inf.ed.ac.uk.
Problems with Lab/Tutorial allocations should be sent to Rob Armitage (email@example.com).
We will keep a log of our lectures, and the collection of log entries will be maintained here. Individual log entries (once written) will be available as direct links from the lecture titles in the schedule below.
If you are a student requiring advance access to materials earlier than the standard 24 hours, please refer to last year's course page. While there may be a few changes, most course materials will remain the same.
The lectures are being recorded. The recordings are on Learn - it's too much hassle to put them anywhere else.
|Meeting||Day||Date||Who||Where||Title||Slides & Handouts||Code|
|1.||Monday||18 Sept||JCB/AR/CA||MEDS MLT||Introduction to CP (log)||sl1, sl1x4||hello.c|
|2.||Tuesday||19 Sept||JCB||MEDS TLT.||Imperative programming, operations, errors (log)||sl2, sl2x4|
|Lab 1||Thur21/Mon25/Tues26||AT 5.05/6.06/5.05||Intro to the DICE Environment (log)||lab1.pdf, lab1-2up.pdf, fwunixref.pdf, emacs.pdf|
|3.||Monday||25 Sept||CA||MEDS MLT||Variables and ints (log)||sl3, sl3x4||square.c, max.c|
|4.||Tuesday||26 Sept||CA||MEDS TLT||Arithmetic operations, int, float, double (log)||sl4, sl4x4||floats.c, quadratic.c|
|Lab 2||Thur28/Mon2/Tues3||AT 5.05/6.06/5.05||Simple arithmetic problems (log)||lab2.pdf, lab2-2up.pdf|
|Tutorial||Tutor||week 3 sheet||tutwk3.pdf t3sol.txt||tutw3b.c, tutw3c.c|
|5.||Monday||2 Oct||CA||MEDS MLT||arithmetic, if-statement(cont.) (log)||sl5, sl5x4||quadratic.c, quadratic2.c|
|6.||Tuesday||3 Oct||CA||MEDS TLT||iteration: for and while (log)||sl6, sl6x4||table.c, fib.c, fib-for.c, lect6code.tar|
|Lab 3||Thur5/Mon9/Tues10||AT 5.05/6.06/5.05||Programming, with some iteration (log)||lab3.pdf, lab3-2up.pdf|
|Tutorial||Tutor||week 4 sheet (log)||tutwk4.pdf tutsoln4.pdf||week4sol.tar|
|7.||Monday||9 Oct||JCB||MEDS MLT||Functions (log)||sl7, sl7x4||days.c days2.c|
|8.||Tuesday||10 Oct||JCB||MEDS TLT||Functions 2 (log)||sl8, sl8x4||global.c, scope2.c|
|Lab 4||Thur12/Mon16/Tues17||AT 5.05/6.06/5.05||Simple Graphics with descartes (log)||lab4.pdf, lab4-2up.pdf||lab4 files|
|Tutorial||Tutor||week 5 sheet||tutwk5.pdf tutsoln5.pdf||week5sol.tar|
|9.||Monday||16 Oct||CA||MEDS MLT||Arrays (log)||sl9, sl9x4||fib-arr.c, whatday3.c, swap.c|
|10.||Tuesday||17 Oct||JCB||MEDS TLT||Practical Programming (log)||sl10, sl10x4, Extra video lecture (10 mins, 30 MB)|
|Lab||Thur19/Mon23/Tues24||AT 5.05/6.06/5.05||Catch-up labs / extra problems||lab45.pdf, lab45-2up.pdf|
|Tutorial||Tutor||catch-up tutorial||tutwk6.pdf t6sol.txt||base.c fbase.c|
|11.||Monday||23 Oct||JCB||MEDS MLT||More practical programming / consolidation (log)||sl11, sl11x4||base-endoflecture.c, base-with-array.c base-without-array.c roman.c,charstuff.c|
|12.||Tuesday||24 Oct||JCB||MEDS TLT||More practical programming / consolidation (log)||sl12, sl12x4||art.c, primes.c, primes_return.c|
|Lab 5||Thur26/Mon30/Tues31||AT 5.05/6.06/5.05||Functions, some pointers, some arrays (log)||lab5.pdf, lab5-2up.pdf, slides8-2015.pdf|
|Tutorial||Tutor||week 7 sheet||tutwk7.pdf t7sol.txt||base.c fbase.c|
|13.||Monday||30 Oct||AR||MEDS MLT||scanf in more detail; char (log)||sl13, sl13x4||roman.c,charstuff.c|
|14.||Tuesday||31 Oct||AR||MEDS TLT||Strings (log)||sl14, sl14x4||hiyacoders.c|
|Lab 6||Thur2/Mon6/Tues7||AT 5.05/6.06/5.05||Arrays and some strings||lab6.pdf, lab6-2up.pdf|
|Tutorial||Tutor||week 8 sheet||tutwk8.pdf t8sol.txt||tutw8a.c|
|15.||Monday||6 Nov||AR||MEDS MLT||Structured Data (log)||sl15, sl15x4||typedef.c, struct.c, struct2.c, enum.c|
|16.||Tuesday||7 Nov||AR||MEDS TLT||Structured Data, cont.; enums; switch (log)||Same slides, more demo||primes_enum.c, pets.c|
|Lab 7||Thur9/Mon13/Tues14||AT 5.05/6.06/5.05||mock exam|
|Tutorial||Tutor||no tutorial sheet - discuss mock||tutwk9.pdf tutsoln9.pdf||bubblesort.c, mergerec.c|
|17.||Monday||13 Nov||AR||MEDS MLT||Searching and sorting (log)||sl17, sl17x4||search.c, bubblesort.c|
|18.||Tuesday||14 Nov||AR||MEDS TLT||Recursion (including mergesort) (log)||sl18, sl18x4||mergerec.c|
|Lab||Thur16/Mon20/Tues21||FH B.LT1||Structured data types||lab7.pdf, lab7-2up.pdf||running.c|
|Tutorial||Tutor||week 10 sheet||tutwk10.pdf||sidebyside.c|
|19.||Monday||20 Nov||JCB||MEDS MLT||Mock exam feedback, Libraries and Separate Compilation||sl19, sl19x4 , slM, slMx4|
|20.||Tuesday||21 Nov||JCB||MEDS TLT||Files in C||sl20, sl20x4|
|Lab 8||Thur23/Mon27/Tues28||AT 5.05/6.06/5.05||Recursion and some File work||lab8.pdf, lab8-2up.pdf|
|21.||Monday||27 Nov||MEDS MLT||No Lecture: Program Arguments, More C slides for self-study||sl21, sl21x4||arg.c|
|22.||Tuesday||28 Nov||MEDS TLT||No Lecture|
|No Lab||AT 5.05/6.06/5.05||Dec 2011|
Your grade for CP will depend on two components. The first part will be a single electronically-submitted piece of coursework, issued on Friday 20 October (end week 5), and due by 16:00, Friday 17 November (end week 9). This work is worth 10% of your overall grade. The second is the final exam, carried out as a computer-based programming test held in the computer labs, taking place at the the end of semester 1. This final exam is worth 90% of your overall grade.
The exam will not assume knowledge of any material from week 10 or 11 lectures.the Library Exam Papers site. Search for Computer Programing: Skills and Concepts from December 2011 onwards (the "CP1" papers are not relevant).
For the past main diet exams (and one re-sit), we have made available the template files and also the automarker that was used to mark the exam:
"A Book on C: Programming in C", 4th edition; by Al Kelley and Ira Pohl.
Informatics Forum, 10 Crichton Street, Edinburgh, EH8 9AB, Scotland, UK
Tel: +44 131 651 5661, Fax: +44 131 651 1426, E-mail: firstname.lastname@example.org
Please contact our webadmin with any comments or corrections. Logging and Cookies
Unless explicitly stated otherwise, all material is copyright © The University of Edinburgh