ECE118 R/RC (Introduction to Programming) Autumn 2025
Tues, Thurs 2:00 - 3:15 in Physics 112


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 19-8-2025    Introductory bits.
Working out what six times nine is.
Sometimes the simplest things are the hardest to do.
The compilation cycle.
Class 2 - Thur 21-8-2025 Why computers use binary instead of decimal.
Modern programming languages are maniacally picky, but for good reason.
Important for Mac owners.
Operators and values.
Class 3 - Tue 26-8-2025 Solving quadratic equations:
step 1: Simplest possible approach just to get started
step 2: That used square root of a negative, this uses numbers that allow a solution
step 3: Named constants have many benefits
step 4: A conditional avoids the square root of negatives
step 5: This also notices when there is only one solution
step 6: User interaction is more flexible and useful
step 7: Two simple new functions make a nice improvement
Listing the numbers between 0 and 10: first incomplete version, and the correct version.
Class 4 - Thur 28-8-2025 A brief guest presentation.
Stack frames/activation records - little boxes of memory where functions remember their details.
Plotting a graph.
Class 5 - Tue 2-9-2025 Storage media (a slight aside).
Important graphics functions and some words about lab 2.
Programs should not use the words while, do, or for until further notice.
Programs should not use the word goto ever.
A closer examination of recursion and some more compelling examples:
      Graph plotter, first mystery, half of it, separating the digits of a number.
Class 6 - Thur 4-9-2025 Good design example: define one constant (width) and make others be a proportion of that.
More recursive divide-and-conquer design:
Printing numbers in words, just the digits,
Introducing arrays to make that more compact,
Plotting a graph that needs scaling,
Spirographs,
Calculating and listing powers of two.
Class 7 - Tue 9-9-2025 Good design: make function leave things exactly as they were when possible.
Plotting a 3D graph, the z axis is represented by colour:
        z = sin(hypot(x, y)) * sin(pow(hypot(x - 5, y - 5), 0.8)), range -10 to 10.
An absurdly long program,
and the tiniest beginnings of an improvement.
Class 8 - Thur 11-9-2025 The complete number speaker, very important to understand the recursion.
(A little aside about capitalising the first letter).
First look at an important example function, be sure you understand it.
Class 9 - Tue 16-9-2025 Lots of useful recursive functions.
There are some (voluntary) exercises to try at the end of that document.
Class 10 - Thur 18-9-2025 Teletypes, paper tape, ASCII in action, parity bits, case sensitivity: the teletype, its keyboard.
A decorative but very bad program.
Defining our own sine function.
Class 11 - Tue 23-9-2025 HKN tutoring, schedule near the top of this page.
Simulating Brownian Motion, prep for clock lab.
Examining the accuracy and improving the efficiency of our sine function.
Searching an array of animals.
Class 12 - Thur 25-9-2025 The binary chop search method.
Measuring time and memory needs, the big O notation.
A bit more about the weird z, s(z), s(s(z)) stuff.
Binary chop search time is O(log(N)), we have already seen another logarithmic time algorithm.
Class 13 - Tue 30-9-2025 Using Unix (needed for next lab),
commands to remember: passwd, pico, CC, ls, cp, mv, mkdir, cd, man, exit, logout.
If you plan to go much further in computing, before long you should learn to use an editor that is seen
as more professional than pico or nano. The best is called emacs, but for some reason vi is more popular.
The normal Unix libraries.
Class 14 - Thur 2-10-2025 remember to use the patterns and practise a lot.
covered cat, pasting, cal, paths, grep (just a little), and editing technique.
Finding square roots with a binary chop search on an array of squares,
The array wasn't necessary, if A[n] always = n*n, just write n=*n instead of A[n],
Now extending it to find square roots of any number surprisingly makes it easier,
The Newton_Raphson method is quite neat and even faster.
Class 15 - Tue 7-10-2025 Questions about the mid-term.
More recursion practise.
Class 16 - Thur 9-10-2025 First mid-term exam.
First sample test,
and another one.
Day off 14th
Class 17 - Thur 16-10-2025 Further exploration of O(), the speed (or slowness) of algorithms:
A faster sorting method, two exponential algorithms, and a cubic one - matrix multiplication as needed for video games.
Matrix operations: step 1, step 2, step 3, step 4, step 5, step 6.
Class 18 - Tue 21-10-2025 Reading data from files.
Bitwise (binary digit) operators.
How random numbers are generated.
A few uses of loops.
Update operators +=, *=, /=, etc, and the less safe ++ and --.
Class 19 - Thur 23-10-2025 The mysterious Collatz sequence, establishing correctness.
The triangle that turned into a snowflake then a fractal star,
Measuring the perimeter of a fractal.
Class 20 - Tue 28-10-2025 More working with files, in particular one that contains the periodic table.
The beginnings of the chemistry calculator: read a formula and print its molecular weight.
All we got to was checking that we had read the file correctly.
Class 21 - Thur 30-10-2025 Review of three function patterns that it is essential to understand, and one more.
Converting strings, e.g. "742" -> 742, and other string manipulations.
Introducing structs by implementing fractions as a new data type.
More of the chemistry calculator:
        Transfering the file's data into arrays,
        First steps in the calculator, e.g. type "Ca S O 4 ." and get mol. wt. of Calcium Sulphate.
Class 22 - Tue 4-11-2025 Completing the fractions implementation, normalisation and euclid's gcd algorithm.
Improving the structure of the chemistry calculator by using structs, and introducing a method.
Class 23 - Thur 6-11-2025 More on constructors.
.peek() and .get() are useful for complicated input,
they made the chemistry calculator much better.
Class 24 - Tue 11-11-2025 the BNF specification.
The complete chemistry calculator, multiple nested (xxx).
Class 25 - Thur 13-11-2025
Class 26 - Tue 18-11-2025 Second mid-term exam.
Files, structs, string manipulations, handling complex input, big-Os.
a sample, and another one.
Class 27 - Thur 20-11-2025 repeating Gaston Julia's experiments.
Break 25th to 30th
Class 28 - Tue 2-12-2025


Lab Assignments

Which lab is assigned on which day?

Lab 1,   Mon 25th Aug - Thur 28th Aug.
(Lab 1 pdf) Using visual C++ to run programs; drawing stars and stick figures.
Lab 2, Tue 2nd Sep - Mon 8th Sep.
(Lab 2 pdf) Divide and conquer: building big programs from little functions.
Lab 3, Tue 9th Sep - Mon 15th Sep.
(Lab 3 pdf) Controlling repetition in programs.
Lab 4, Tue 16th Sep - Mon 22nd Sep.
(Lab 4 pdf) A video game: blowing things up with a cannon.
[the function int random_in_range(const int a, const int b) returns a random int between a and b inclusive].
Lab 5,   Tue 23rd Sep - Mon 29th Sep.
(Lab 5 pdf) A real-time animated clock application.
Lab 6,   Tue 30th Sep - Mon 6th Oct.
(Lab 6 pdf) Generating calendars and using Unix.
Lab 7,   Tue 7th Oct - Mon 20th Oct.
(Lab 7 pdf) A happy street scene.
Lab 8,   Wed 15th Oct - Mon 27th Oct.
(Lab 8 pdf) An interactive desk calculator.
Lab 9,   Wed 22 Oct - Mon 3 Nov.
(Lab 9 pdf) Meteorological data processing and visualisation. the data files.
Lab 10,   Tue 4 Nov - Mon 10 Nov
(Lab 10 pdf) Database programming under Unix.
The special timing function.
Lab 11,   Tue 11 Nov - Mon 17 Nov
(Lab 11 pdf) A robot searching for treasure in a maze. sample maze; alternate sample.


The Remainder Of Last Year's Lab Assignments

This year's labs will NOT be the same, but will be similar.
You get no points for turning in a solution to last year's labs.

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

Lab 12,   Wed 13 Nov - Tue 19 Nov
(Lab 12 pdf) An automatic robot: he turned into a video game.




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.