EEN218 (Programming 2) Autumn 2003
- Downloads: Software to make things work
- The books
- Guide to using stdio for input and output
- Review of Recursion, An animation of some recursive functions.
- Introduction to Web-based programming with CGI.
- How to Time a Running Program (Improved, accurate version, 18th Sept 2003).
- Mid-Terms: Thursday 23rd October.
- Final Examination on Thursday 11th December, 11am to 1pm.
- IMPORTANT: Set up mail forwarding.
- Assignments:
- Due Thursday 25th September.
e-mail the source file to grader@rabbit.eng.miami.edu
Read a database of people into an array of structs. Answer simple queries from the user.
One type of query should be search; one type of query should be sort (by birthdate, etc)
and show first 20. Database files for download:
500 people,
1000 people,
1500 people,
2000 people,
2500 people,
3000 people,
3500 people,
4000 people,
4500 people,
5000 people,
6000 people,
7000 people,
8000 people,
9000 people,
10000 people. If using rabbit, no need to download;
just access the files called "~data/people-2000.txt", etc.
- Due Thursday 9th October.
Make the sorting operation into a separate function that measures and returns as its result
the time it took to perform the sort. Make your program perform sorts with a reasonable
number of different data sizes, and keep the sizes and times in an array. Make your
program perform linear regression
on logarithms of array contents to find formula relating sort time to data size.
- Due Thursday 30th October.
Modify either of the previous two assignments (or re-write if you prefer) to make
it truly flexible. There should be no preset limit to the size of database processed,
arrays should be resized dynamically as needed.
- Due Wednesday 26th November.
Using the CGI web programming interface, choose one of: Date Calculator (given year,
month, day, and N, calculate date and day of week N days after the given date. No
limits on year or N); Calendar Creator (given year and month, display a nicely
formatted calendar, no limits on which year user may select); Numeric Super-Calculator
(take two integers, may be 100 or more digits, and an operation (plus, minus, times,
power, factorial (division is extra credit) and display answer with perfect accuracy).
Sample CGI programs can be Sampled Here; you can't see
the C++ code, but you can get sample runs, and use "view source" to see how the HTML
formatyting was done.
- Class History:
- Class 1 (28-8-2003) General introductions; preparation for the prerequisites test.
- Class 2 (2-9-2003) Introduction to unix systems.
- Class 3 (4-9-2003) The prerequisites test.
- Class 4 (9-9-2003) Dealing with large amounts of data, part 1. A database in arrays.
- Class 5 (11-9-2003) Large Data, part 2. sorting and searching in arrays. N2 and N×log2N compared.
- Class 6 (16-9-2003) Assignment 1 set; Using argc and argv; Defining structs to simplify data representations.
- Class 7 (18-9-2003) String processing, character codes, timing programs.
- Class 8 (23-9-2003) Do-it-yourself input functions using <stdio.h> to avoid the awkwardness of <iostream>
- Class 9 (25-9-2003) Using pointers to structs instead of structs directly; * and ->; the new keyword.
- Class 10 (30-9-2003) Examples of programming style; timing programs; linear regression and logarithms to find formula.
- Class 11 (2-10-2003) Reading and writing complex declarations in C++; what else? I've forgotten.
- Class 12 (7-10-2003) Using pointers vs. not using pointers: side-by-side comparison, calculating memory use, etc.
- Class 13 (9-10-2003) Removing an entry; A pointer to an array allows array size-change to be simulated.
- Class 14 (14-10-2003) FlexArrays (or Vectors); comparison of efficiency: increment vs multiply size; making it an object.
- Class 15 (16-10-2003) Protected members and friend functions; more templates.
- Class 16 (21-10-2003) Test subject reminders; computationally useful struct examples (C++ project zipped).
- Class 17 (23-10-2003) Test Today!!!
- Class 18 (28-10-2003) Fast Sorting: Principles of Mergesort and Quicksort: Deriving the partitioning method.
- Class 19 (30-10-2003) Things we learned from the test; more quicksort: formalising the algorithm.
- Class 20 (4-11-2003) Complete example with quicksort, reasoning about its speed.
- Class 21 (6-11-2003) Examining the recorsion in quicksort, showing it is usually O(N×logN); more recursion examples.
- Class 22 (11-11-2003) Case study in recursion and image processing: counting objects in a digital image.
- Class 23 (13-11-2003) Web programming with the CGI interface.
- Class 24 (18-11-2003) Part 2 of CGI programming; hints about big-int and calendar calculations.
- Class 25 (20-11-2003) Topics for the test; introduction to big-int functions; safeint{int+double} object example.
- Class 26 (25-11-2003) Test Today!!!
- Class 27 (2-12-2003) Test review; back to safeints: using protected and public; constructors
- Class 28 (4-12-2003) Evaluations; more protected and public; operator definition; constructors as type converters.