Class 1 | Tue 25‑8‑2015 | Quick introductions, etc. The bad old days: one, two, three, four, five. Trivial things are difficult sometimes. The inside of a computer, partly illustrated by Colossus: A, B, C, a pentode vacuum tube. one of the reasons computers work in binary. | ||||
Class 2 | Thur 27‑8‑2015 | Our first programs. Setting up a visual studio project. Text or graphical output. | ||||
Class 3 | Tue 1‑9‑2015 | Some simple C++ programming: Writing the same thing 1000 times, Defining our own functions: A much less annoying version, A cleverer version that illustrates a neat idea, This version (if completed) allows easy verification of the results. Introducing conditional execution: A Quadratic equation solver. | ||||
Class 4 | Thur 3‑9‑2015 | Named constants, functions that return values, bools, interactive testing, never trust a double in an equality test. All in one example. | ||||
Class 5 | Tue 8‑9‑2015 |
An attempt to control repetition properly, Didn't work perfectly. We'll make the computer tell us what happened, It was obvious, now it is fixed. Now we'll look at the fixed version with the debugging put back in, And see what happens when the order is changed. Make sure you understand this. This produces a general function pattern for counting down, Counting up requires another parameter, as there is no obvious stopping place, We can build that into a function tabulator. This function produces interesting output, work on understanding it. | ||||
Class 6 | Thur 10‑9‑2015 | The two basic forms of controlled repetition, in various shapes. One of them used to plot graphs: little functions doing little things but working together to do big things - the key to getting programs right. A rather square spirograph pattern. | ||||
Class 7 | Tue 15‑9‑2015 | Printing the (decimal) digits of a number one-by-one. Adapting it, and using a friendly string, to do some naive encryption. Printing a number in words, as on a cheque. This introduces arrays. Finding the sum of a sequence of squares, a function that calculates and returns a non-trivial result. | ||||
Class 8 | Thur 17‑9‑2015 | The sweaty day. Starting to do more complicated things: Converting to and from different bases, wrapper funmctions and other things. Calculating how many digits are in a number, and ten-to-the-power-of(X). That lead to a different approach to separating out the decimal digits of a number. It was quite complicated. The moral is, don't always jump on the first solution method that pops into your head, there may be better ones that come after a little more thought. | ||||
Class 9 | Tue 22‑9‑2015 | Trying to completely control the return from a function,
version one,
two,
three, and finally
four, using an accumulating parameter. The triangle that turned into a fluffy star, | ||||
Class 10 | Thur 24‑9‑2015 | All the operators and data types and dull rules. The star is a fractal, which we measure. See what varieties you can come up with. A program that takes a long time to type. The beginnings of a much better version. | ||||
Class 11 | Tue 29‑9‑2015 | Practice with Unix. The while loop for unlimited repetition. Variables still not allowed. Extending the number sayer, can you complete it, so that it can speak correctly every possible int value? | ||||
Class 12 | Thur 1‑10‑2015 | Reviews of all sorts of things. words, discovering the Binary Chop Search, numbers. | ||||
Review | Pre-test reviews: Saturday 3rd from 12 to 2 pm, and Sunday 4th from 1 to 2 pm. Locations: The lab room, 237. | |||||
Class 13 | Tue 6‑10‑2015 | Test Day. A sample, and another one. | ||||
Class 14 | Tue 13‑10‑2015 | A case study in thoughtful programming. | ||||
Class 15 | Thur 15‑10‑2015 | More things you can do with unix. Investinging the fibonnacci sequence and similar things, and allowing variables. | ||||
Class 16 | Tue 20‑10‑2015 | A simple simulation: Brownian motion. What does the fibonnacci sequence converge to? Update assignments, for loops, do loops, break - more bits of C++. | ||||
Class 17 | Thur 22‑10‑2015 | The dangers of complacency. Pong: Another case study, come up with amusements to hone your programming skills. | ||||
Class 18 | Tue 27‑10‑2015 | Starting file processing, ifstreams and ofstreams. The official C++ #includes, iostream, fstream, string, and using namespace std; Finding out how many unique words are in a file. | ||||
Class 19 | Thur 29‑10‑2015 | A function that compares two strings caselessly, so "cat" = "CAT" and "Mouse" = "mouse". A function that converts a string to all lower case. A function that also removes punctuation from strings. Keeping the array in alphabetical order. Adding words will be slower, but searching much fasrter. if (! x) is more commonly used than if (x == false), but the latter adds emphasis to the meaning. | ||||
Class 20 | Tue 3‑11‑2015 | The internal binary representation of numbers, What typecasts really do: int/double change representation, others just disguise the type. This function doesn't work. Why not? Introducing reference parameters: this one does work. | ||||
Class 21 | Thur 5‑11‑2015 | The triangle that sorts. Comparing linear, quadratic, and logarithmic algorithms. Introducing structs: a table of information, and a program that reads it. | ||||
Class 22 | Tue 10‑11‑2015 | A small side-example of structs, implementing rational numbers as a usable C++ type. Euclid's algorithm for greatest common divisor. Adding an input object to the chemistry calculator Included here with the error still in place, it is a very simple one, you should be able to work it out. | ||||
Class 23 | Thur 12‑11‑2015 | More developments: Better structure, dealing with numbers, etc. | ||||
Review | Sat & Sun | Saturday 14th at 1 pm, and Sunday 15th at 2 pm. In EB 216 or 237 or 304. It will be made easy to find. | ||||
Class 24 | Tue 17‑11‑2015 | At last it's finished. Structs and files and arrays and recursion in in a useful program. | ||||
Class 25 | Thur 19‑11‑2015 | Second Test Day. Some old sample questions. | ||||
Class 26 | Tue 1‑12‑2015 | From our implementation of rational numbers to a basic "reverse polish" calculator. | ||||
Class 27 | Thur 3‑12‑2015 | Stacks and Queues and Reverse Polish Notation. We made a rational number interactive calculator. | ||||
Class 28 | Tue 8‑12‑2015 | We did test 2 together. | ||||
Review | Sat & Sun | Saturday 12th at 12 noon, and Sunday 13th at 2 pm. In EB 216 or 237 or 304. It will be made easy to find. |
Lab 1, | Mon 31 Aug - Thur 3 Sept | |||||
(pdf) | Using visual C++ to run programs; drawing stars and stick figures. | |||||
Lab 2, | Tues 8 Sept - Mon 14 Sept | |||||
(pdf) | Divide and conquer: building big programs from little functions. | |||||
Lab 3, | Tues 15 Sept - Mon 21 Sept | |||||
(pdf) | Controlling repetition in programs. | |||||
Lab 4, | Tues 22 Sept - Mon 28 Sept | |||||
(pdf) | A video game: exploding the enemy with a cannon. | |||||
Lab 5, | Tues 29 Sept - Mon 5 Oct | |||||
(pdf) | A real-time animated clock application. | |||||
Lab 6, | Mon 12 Oct - Thur 15 Oct | |||||
(pdf) | Generating calendars and using Unix. | |||||
Lab 7, | Mon 19 Oct - Thur 22 Oct | |||||
(pdf) | A randomly generated Happy Street Scene. | |||||
Lab 8, | Mon 26 Oct - Thur 29 Oct | |||||
(pdf) | An interactive desk calculator. | |||||
Lab 9, | Mon 2 Nov - Thur 5 Nov | |||||
(pdf) | Meteorological data processing and visualisation. the data files | |||||
Lab 10, | Mon 9 Nov - Thur 12 Nov | |||||
(pdf) | Database programming under Unix. Data files: data1.txt, 2, 3, 5, 10, 20, 30, 50, 100. The special timing function. | |||||
Lab 11, | Mon 16 Nov - Thur 19 Nov | |||||
(pdf) | A robot seaching for treasure in a maze.
sample maze. | |||||
Lab 12, | Mon 30 Nov - Thur 3 Dec | |||||
(pdf) | An automatic robot: he turned into a video game. | |||||
Mon 14 Dec | ||||||
Last day anything will be accepted for grading. |