EEN118 R (Programming 1) Spring 2014
Tues, Thurs 2:00-3:15 in MM-117

Class History

Class 1  ‑ Tue 14‑1‑2014   Quick introductions. What C++ is and what it does for us. Setting up a visual studio project.
Why programming libraries are important.
A first program.
Class 2  ‑ Thur 16‑1‑2014 Learn to program by doing it.
An angry calculating program, and a small graphical program.
Class 3  ‑ Tue 21‑1‑2014 All the operators and data types and dull rules,
One reason binary is useful,
Remember to use const, it is important.
Class 4  ‑ Thur 23‑1‑2014 Why our C++ doesn't look like this.
Some programming experiments:
An equilateral triangle by calculation inflexible, a much better flexible version.
An alternative equilateral triangle, all by relative movements.
Lots of squares in a spirograph pattern.
Class 5  ‑ Tue 28‑1‑2014 "this is not a string"
const string this_is_a_string = "but this still isn't";
Playing with unix for a change.
Controlling repetition in four steps: Bad, A better idea, Quite clever, Perfection.
And now we have mastered flexible repetition we can do so many things very easily.
Class 6  ‑ Thur 30‑1‑2014 Now we can handle repetition effectively, some practice. a much nicer spirograph,
Strange number printing and how to analyse a mysterious function,
Interactive testing, a simple variation, an array, a producer of giant patterned numbers.
How it really works: stack frames in a stack, positions are relative.
Class 7  ‑ Tue 4‑2‑2014 A program that is over a megabyte long:
A bad attempt at something useful, now cut down to a reaonable beginning,
extending the range to 99, to 999, to 999999, and finally to cover every possible int.
Progress at an exponential rate.
Class 8  ‑ Thur 6‑2‑2014 Trying out our unix accounts.
Some graph plotting, and exploring colour spaces.
Class 9  ‑ Tue 11‑2‑2014 Practice with functions that calculate values. some simple ones first,
Now the Mysterious Collatz Sequence, and a Graphical representation of it.
Class 10  ‑ Thur 13‑2‑2014 Creeping up on the sine approximation,
The Slightly Alarming Sine Approximation,
A nice colourful comparison of all the sine approximations.
Class 11  ‑ Tue 18‑2‑2014 Unix command reminders: passwd, exit, logout, whoami, cat, more, cp, rm, mv, ls, chmod, mkdir, cd, pwd, be careful with *, control-C not control-Z, ps, kill, CC, pico.
The binary chop search guessing game.
Class 12  ‑ Thur 20‑2‑2014 Binary chop search on a dictionary array.
And to find very accurate square roots, also introducing cout.
Saturday 22nd at 1 pm: voluntary pre-exam review session.
Class 13  ‑ Tue 25‑2‑2014 Mostly review, but we are introduced to string.substr() and the idea of accumulator parameters.
The example of the triangle that turned into a snowflake, then mysteriously stopped working, together with an explanation of what went wrong.
Tuesday 25th at 7 pm: voluntary pre-exam review session.
Class 14  ‑ Thur 27‑2‑2014 First Mid-Term Test.
Class 15  ‑ Tue 4‑3‑2014 How to make bees, and what a caprimulgus does at night.
Variables: sometimes helping, sometimes hindering.
Class 16  ‑ Thur 6‑3‑2014 Adventures with Fibonacci's sequence:
1: plain old recursive - be sure you understand why it is so slow.
2: memoised - remember previous answers, extremely fast.
3: better - no more global array.
4: preemptive - why wait to be asked? Work out all answers in advance.
5: a redesign - recursive again, but good and fast this time.
And Almost Conway's game of Life.
Break
Class 17  ‑ Tue 18‑3‑2014 Reference parameters allow results from functions.
ofstreams for creating disc files.
A big triangular program that puts some variables in order.
A program that writes its own sorting program, but it is imperfect, it uses a global variable.
Class 18  ‑ Thur 20‑3‑2014 Playing with sorting a bit more, and learning some new things.
Reading the numbers from a file.
All those variables: we should have been using an array.
All that repetition: we should have been using loops.
The "for" loop can be very convenient.
We also want to be able to sort any number of numbers.
And now we can overwrite the original file.
Update operators are useful too.
Class 19  ‑ Tue 25‑3‑2014 Introducing objects and exploring a few other things:
the beginning of a molecular weight calculator as a case study,
The data set.
Class 20  ‑ Thur 27‑3‑2014 Question 3 make-up at start of class.
adding "nicestream", a version of cin that is more convenient for our purposes.
Class 21  ‑ Tue 1‑4‑2014 A reminder of two unfortunate things about cin: one, two.
Using < and | and > to redirect program input and output. The getline function.
The nicestream, our own nicer version of cin.
Class 22  ‑ Thur 3‑4‑2014 The dangers of over-confidence.
The useful case study complete, and our recursive programming techniques made what could have been a very complicated enhancement very easy.
Your practice challenge: the process_formula function has grown big and hard to read. Tame it.
Class 23  ‑ Tue 8‑4‑2014 Recursion with arrays.
Class 24  ‑ Thur 10‑4‑2014 More practice with objects and things.
Sat 12th from 3.00 to 5.00: voluntary pre-exam review session.
Class 25  ‑ Tue 15‑4‑2014 Second test. Two old tests as samples: one, two.
Class 26  ‑ Thur 17‑4‑2014 Simulations: the bad bad bunnies,
and a very dangerous situation, but the program just evolved and is in need of better structuring.
Class 27  ‑ Tue 22‑4‑2014 Restructuring the untidy simulation, an object for all the actors, and an object for the whole universe, the case of the justified global variable. Keeping things comprehensible and easily modifiable. The final version.
Class 28  ‑ Thur 24‑4‑2014 Merging files - simple ideas, it only looks complicated.
What the future holds: pointers, new, delete, binary trees.
One little hack.
Sat 26‑4‑2014 3 to 5 pm, Pre-final review session 1.
Tue 29‑4‑2014 Last day anything will be accepted for grading.
Sat 3‑5‑2014 3 to 5 pm, Pre-final review session 2.


Lab Assignments

Lab 1, Tues 21 Sept - Mon 27 Sept
(pdf) Using visual C++ to run programs; drawing stars and stick figures.
Lab 2, Tues 28 Sept - Mon 3 Feb
(pdf) Divide and conquer: building big programs from little functions.
Lab 3, Tues 4 Feb - Mon 10 Feb
(pdf) Controlling repetition in programs.
Lab 4, Tues 11 Feb - Mon 17 Feb
(pdf) A video game: exploding the enemy with a cannon.
Lab 5, Tues 18 Feb - Mon 24 Feb
(pdf) Generating calendars and using Unix.
Lab 6, Tues 25 Feb - Mon 3 Mar
(pdf) A real-time animated clock application.
Lab 7, Tues 4 Mar - Thur 6 Mar, and Mon 17 Mar
(pdf) A randomly generated Happy Street Scene.
Lab 8, Tues 18 Mar - Mon 24 Mar
(pdf) An interactive desk calculator.
Lab 9, Tues 25 Mar - Mon 31 Mar
(pdf) Meteorological data processing and visualisation. the data files
Lab 10, Tues 1 Apr - Mon 7 Apr
(pdf) Database programming under Unix.
Data files: database1.txt, 2, 3, 5, 10, 20, 30, 50, 100.
The special timing function.
Lab 11, Tues 8 Apr - Mon 14 Apr
(pdf) A robot seaching for treasure in a maze. sample maze
Lab 12, Tues 15 Apr - Mon 21 Apr
(pdf) An automatic robot: he turned into a video game.
Tues 29 Apr
Last day anything will be accepted for grading.