ECE118 R (Programming 1) Autumn 2023
Tues, Thurs 2:00 - 3:15 in LC 140


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 22-8-2023    Introductory Bits.
Why computers use binary instead of decimal.
Working out what six times nine is.
The essential take-aways from today's class.
Class 2 - Thur 24-8-2023 The missing example.
A mystery object: (one), (two).
Core memory, one, two, three, four.
Our slightly unusual approach.
Sometimes the simplest things are the hardest to do.
Libraries.
For mac users: How to install VirtualBox (video instructions), (text instructions). Parallels for ARM.
Visual studio. Here it is.
Starting to do some programming, this is our first program.
Expressions, Statements, and Declarations. Types and Operators.
The essential take-aways from today's class.
Class 3 - Tue 29-8-2023 Follow the rules. No PDFs.
Here are all the operators we are going to see this semester.
A sample of the first test.
Do things the class way for now. No variables, asssignments, loops, or couts.
Our first real program - solving quadratic equations.
The essential take-aways from today's class.
Class 4 - Thur 31-8-2023 The lab guys' help page for getting set up.
Another function definition.
Adding another function, just for a further example.
The rules of C++ so far.
The compilation process.
Counting down, counting up, tabulating a formula.
The essential take-aways from today's class.
Class 5 - Tue 5-9-2023 New lab, just define the length.
Turn left draw distance etc etc etc.
Today's graph plotting.
The essential take-aways from today's class.
Class 6 - Thur 7-9-2023 Mention HKN,
Proper scaling to finish off the graph plotting.
Adding up all the values a function has over a range of x values.
Finding the maximum value of a function over a range.
More about recursion: at top, both, string, digits.
A ridiculously long program.
The essential take-aways from today's class.
Class 7 - Tue 12-9-2023 Lab 3, sin, cos, radians.
The perfected number speaker.
Limits: ints, 10**, 2**, doubles in four programs: tens, twos, doubles, smaller.
The essential take-aways from today's class.
Class 8 - Thur 14-9-2023 n.cpp, floating format.
draw square, rotate a bit, screen saver (sorry, didn't upload it).
Our own sine, power, factorial, sine.
The essential take-aways from today's class.
Class 9 - Tue 19-9-2023 Where does the cannonball start? How do you detect victory?
Seeing how the sine function gains its accuracy.
Today's clicker questions.
Searching an array of animal names.
The essential take-aways from today's class.
Class 10 - Thur 21-9-2023 Corrected and improved sine thing from Tuesday.
Today's clicky questions.
We discovered the Binary Chop Search, an extremely fast method.
Complexity classes, big O, and what they mean, Linear, logarithmic, quadrating, etc.
Printing numbers is also logarithmic, in most ways.
The essential take-aways from today's class.
Class 11 - Tue 26-9-2023 About lab 5, and when is the test?
Today's clicky questions.
"in most ways"?
Implement binary chop search on the animals.
Integer square roots by searching an array of squares, but the array is unnecessary.
The essential take-aways from today's class.
Class 12 - Thur 28-9-2023 Updated HKN tutoring times.
The over-estimate was dangerous.
Brownian motion.
Unix.
The essential take-aways from today's class.
Class 13 - Tue 3-10-2023 Unix lab starts today.
The correct limits for integer square root.
Introduce cout.
The essential Unix commands and pico/nano editor controls.
Today's clicky questions.
The Newton-Raphson method:
        The basic version,
        Adding an accurate print,
        A better first guess,
The essential take-aways from today's class.
Class 14 - Thur 5-10-2023 cout << and variables.
factorial, sine, fibonnaci, multiplication table, and all sorts using variables.
The essential take-aways from today's class.
Class 15 - Tue 10-10-2023 Today's clicky question. You must verify.
Test review. Be prepared with questions or it won't be much help.
All constants!
Class 16 - Thur 12-10-2023 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 17 - Thur 19-10-2023 A few words about the new calculator lab.
Click for attendance only.
A very simple triangle, soon to be complicated into a fractal star.
Introducing the official libraries <iostream>, <string>, <iomanip>, <fstream>, <cmath>.
More loops with variables: Collatz (with a break statement) and binary chop square roots.
We almost reformatted this familiar file.
The essential take-aways from today's class.
Class 18 - Tue 24-10-2023 Continuing from last class, I want atomic number, then name, then symbol, then atomic weight, in nice columns.
First by manipulating strings and numbers, and here are The ASCII codes.
Second the easy way with setw.
Attempting a word count on Peter Pan, too hurried, the mistake is obvious.
The essential take-aways from today's class.
Class 19 - Thur 26-10-2023 The completed Peter Pan word count, ignoring punctuation and case insensitive.
Today's clicky question (actually it was meant for Tuesday). You must verify.
Foolish EBCDIC and new unicode.
<cctype>: All of its functions, and the program that produced that table.
Using structs for the elements.
The essential take-aways from today's class.
Class 20 - Tue 31-10-2023 Things from the mid-term: analysing and creating recursive functions.
Today's clicky question. You must verify.
Only a little time left, so just improving the structure of the periodic table program.
Class 21 - Thur 2-11-2023 We got a long way with our chemistry calculator,
(there are some important reminders at the top of that file).
It introduced the idea of a method, which is the big thing in Object Oriented Programming.
The essential take-aways from today's class.
Class 22 - Tue 7-11-2023 A bit about labs 11 and 12 with two dimensional arrays.
Today's clicky question. You must verify during class.
The triangular sorting thing.
The essential take-aways from today's class.
Class 23 - Thur 9-11-2023 The complete chemistry calculator, parentheses and all.
Teaching C++ how to use fractions, only the beginning.
The essential take-aways from today's class.
Class 24 - Tue 14-11-2023 Forgot to do this: Today's clicky question. You must verify during class.
What we did today: the pdf part (only q7), and the parts done on rabbit.
Class 25 - Thur 16-11-2023 Second mid-term. The topics are:
Doing useful things with loops and variables,
Working with files and strings, and
Working with classes and objects.
First sample, and second sample.
Class 26 - Tue 28-11-2023 Finishing fractions, normalisation and greatest common divisor.
A little bit about mathematical things in <cmath>, link near the top of this page.
Half way through the adventure of the boy and the bull.
Class 27 - Thur 30-11-2023 Finish the simulation, This is a less complicated version.
updates, do, for, and switch.
The complex numbers business and the strange behaviour of z = z2+c.
Class 28 - Tue 5-12-2023 Whatever needs to be said about the second test.
Some Julia sets, and
a map of them, the Mandelbrot set.


Lab Assignments

Which lab is assigned on which day?

Submit assignments as a single document (word documents are preferred), including all your code and screenshots of it running, through blackboard.

Lab 1,   Mon 28 Aug, Tue 29 Aug, Wed 30 Aug, Thur 31 Aug
(pdf) Using visual C++ to run programs; drawing stars and stick figures.
Lab 2,   Mon 11 Sept, Tue 5 Sept, Wed 6 Sept, Thur 7 Sept
(pdf) Divide and conquer: building big programs from little functions.
Lab 3,   Mon 18 Sept, Tue 12 Sept, Wed 13 Sept, Thur 14 Sept
(pdf) Controlling repetition in programs.
Part C2 is for extra credit only.
Lab 4,   Mon 25 Sept, Tue 19 Sept, Wed 20 Sept, Thur 21 Sept
(pdf) A video game: blowing things up with a cannon.
(the useful functions whose names I couldn't remember are get_x_position() and get_y_position())
Lab 5,   Mon 2 Oct, Tue 26 Sept, Wed 27 Sept, Thur 28 Sept
(pdf) A real-time animated clock application.
Lab 6,   Mon 9 Oct, Tue 3 Oct, Wed 4 Oct, Thur 5 Oct
(pdf) Generating calendars and using Unix.
Lab 7,   Mon 23 Oct, Tue 10 Oct, Wed 11 Oct, Thur 12 Oct
(pdf) A happy street scene.
Lab 8,   Mon 30 Oct, Tue 24 Oct, Wed 18 Oct, Thur 19 Oct
(pdf) An interactive desk calculator.
Lab 9,   Mon 6 Nov, Tue 31 Oct, Wed 25 Oct, Thur 26 Oct
(pdf) Meteorological data processing and visualisation. the data files.
Lab 10,   Mon 13 Nov, Tue 7 Nov, Wed 1 Nov, Thur 2 Nov
(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.
(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.
(pdf) An automatic robot: he turned into a video game.