ECE118 R/RC (Introduction to Programming) Autumn 2024
Tues, Thurs 2:00 - 3:15 in MM 200


Accessing your Unix accounts, once they have been set up:
PC log in - use Putty or your own preferred SSH app.
OR mac users: start the terminal app, windows users: start powershell, then type the command
ssh username@rabbit.eng.miami.edu and type your password when prompted.
Windows users beware: you can't use ctrl-V in pico, but page up and page down will do the job.

Class History

Class 1 - Tue 20-8-2024    Introductory Bits.
Why computers use binary instead of decimal.
Class 2 - Thur 22-8-2024 Working out what six times nine is.
Sometimes the simplest things are the hardest to do.
The compilation cycle.
Important for Mac owners.
Operators and values.
Class 3 - Tue 27-8-2024 int, double, bool, string, char, %, ASCII, paper tape, and this.
A bigger example, but a bit before its time. Do not be concerned with the details yet.
Built-in mathematical functions.
A sample of the first test.
The need for pickiness and redundancy in programming languages.
Class 4 - Thur 29-8-2024 Scope (nore-or-less = curly brackets) different versions with same name, nothing changes.
The program is utterly useless, it just illustrates some things that need to be illustrated.
The extreme importance of your program having proper visual structure. This is just terrible.
Recursion, first steps int controlling repetition. Displaying a count-down.
First try, worked to start with, but didn't know to stop at 0,
so we told it to stop at 0 and now it works perfectly.
An addition to illustrate another useful effect of recursion..
Class 5 - Tue 3-9-2024 (new mac instructions)
The effect of holidays on due dates.
exp(-x) * sin(10 * x) * cos(5 * x), x from 0 to 5, y from -1 to 1.
z = sin(hypot(x, y)) * sin(pow(hypot(x - 5, y - 5), 0.8)), range -10 to 10.
Adventures in graph plotting: just tabulating, sine wave, something more decorative, three dimensional.
Class 6 - Thur 5-9-2024 Lab 3.
Better structure: first, second, axes.
Find sum, minimum, maximum.
Class 7 - Tue 10-9-2024 Ten to the power ofs (v1), (v2), then twos, then use doubles.
(correct figures for a double: 1 bit sign, 11 bits exponent, 52 bits mantissa)
Printing numbers digit by digit backwards, backwards then forwards, forwards only, introducing arrays.
Something similar but absurdly long.
Starting on a better version.
Class 8 - Thur 12-9-2024 The completed number sayer. (those who have programmed before, how could this be done without recursion?)
Here's how. Still no loops or variables though.
Making our own sine function.
Class 9 - Tue 17-9-2024 Four steps towards our own sine function: one, two, three, four.
Consider the big Os.
Class 10 - Thur 19-9-2024 Big-O meaning, Only care if time big => N big, highest term outweighs others, constant factor useless, expand from one measurement.
Weird arithmetic.
Physical human sorting.
Examined some constant, linear, quadraric, and cubic functions/algorithms.
And now the potential for a logarithmic one: lots of animals.
Class 11 - Tue 24-9-2024 Brownian motion.
The while loop, allowed if expression is constant or function result.
Screen savers and other mild entertainments.
Back to the binary chop search on the animals.
Class 12 - Thur 26-9-2024 Finding integer square roots by binary chop search, the table proved unnecessary.
Extending the method for doubles, when to stop? Counting steps is good.
You can use cout instead of print now if you prefer. <iomanip> too.
structs are a useful tool: A catalogue for the on-line animal shop.
Class 13 - Tue 1-10-2024 Using unix.
Class 14 - Thur 3-10-2024 Manipulating data range, the formula I had forgotten last week.
Back to our square-root functions for a few minutes:
      Binary chop search, Newton-Raphson, NR with better first guess.
Newton-Raphson with the exponent and mantissa trick is unbeatable for square roots and similar.
Knapsack (all combinations) in three steps: one, two, three.
Class 15 - Tue 8-10-2024 How long would it take to solve the knapsack problem with 2000 packages? Some comparisons, but not close.
Recent theories (^ is power of): 10^80 atoms in universe, 10^106 years until no matter left.
Knapsack problem on a mere 2000 packages requires 2^2000 or 10^602 indivdual operations (actually worse, 2x10^605).
If every atom in the universe turned into a 1THz supercomputer all working on this problem until the universe is all gone, only time for 3x10^205 operations.
Class 16 - Thur 10-10-2024 (Recorded)The triangle that turned into a fractal star,
and the weirdness when the detours get sharper.
Plotting the length of the Collatz sequence with a loop.
The knapsack problem with variables, loops, and arrays.
Day Off 15th
Class 17 - Thur 17-10-2024 Test preparation as needed. Be prepared with questions.
Class 18 - Tue 22-10-2024 First test. Do not use variables: functions and consts only.
Questions as in the sample:
  1. Operators, types, priority.
  2. Understanding recursive functions.
  3. Creating recursive functions.
And here is another sample to try out.
Class 19 - Thur 24-10-2024
Class 20 - Tue 29-10-2024
Class 21 - Thur 31-10-2024
Class 22 - Tue 5-11-2024
Class 23 - Thur 7-11-2024
Class 24 - Tue 12-11-2024
Class 25 - Thur 14-11-2024
Class 26 - Tue 19-11-2024
Class 27 - Thur 21-11-2024
Break 26th to 29th
Class 28 - Tue 3-12-2024


Lab Assignments

Which lab is assigned on which day?

Submit assignments as a single word .docx document, including all your code and screenshots of it running, through blackboard.

Lab 1,   Mon 26th Aug - Thur 29th Aug.
(Lab 1 pdf) Using visual C++ to run programs; drawing stars and stick figures.
Lab 2, Tue 3rd Sep - Mon 9th Sep.
(Lab 2 pdf) Divide and conquer: building big programs from little functions.
Lab 3, Tue 10th Sep - Mon 16th Sep.
(Lab 3 pdf) Controlling repetition in programs.
Lab 4, Tue 17th Sep - Mon 23rd Sep.
(Lab 4 pdf) A video game: blowing things up with a cannon.
Lab 5,   Tue 24th Sep - Mon 30th Sep.
(Lab 5 pdf) A real-time animated clock application.
Lab 6,   Tue 1st Oct - Mon 7th Oct.
(Lab 6 pdf) Generating calendars and using Unix.
Lab 7,   Not happening this semester due to last week's closure.
(Lab 7 pdf) A happy street scene.
Lab 8,   Wed 16th Oct - Tue 22nd Oct.
(Lab 8 pdf) An interactive desk calculator.




Last Semester's Assignments

The labs change every semester, and you don't get any credit for turning in an assignment from the wrong semester. This is just so you can see more-or-less what is coming.

Lab 9,   Mon 6 Nov, Tue 31 Oct, Wed 25 Oct, Thur 26 Oct
(Lab 9 pdf) Meteorological data processing and visualisation. the data files.
Lab 10,   Mon 13 Nov, Tue 7 Nov, Wed 1 Nov, Thur 2 Nov
(Lab 10 pdf) Database programming under Unix.
The special timing function.
Lab 11,   Set: Mon 27 Nov, Tue 14 Nov, Wed 8 Nov, Thur 9 Nov.
Due: Mon 4 Dec, Mon 27 Nov, Wed 15 Nov, Thur 16 Nov.
(Lab 11 pdf) A robot seaching for treasure in a maze. sample maze; alternate sample.
Lab 12,   Set: Mon 4 Dec, Tue 28 Nov, Wed 15 Nov, Thur 16 Nov.
Due: Mon 11 Dec, Tue 5 Dec, Wed 29 Nov, Thur 30 Nov.
(Lab 12 pdf) An automatic robot: he turned into a video game.