Today we talked about vectors and also did some sample "vectors and functions" problems.
The file we used is vectorFunctionProblems.cpp.
That file also contains a bunch more practice problems that're directly relevant for the upcoming midterm.
Here are solutions to the practice problems.
I've also added one new problem to the problems file
(and included its solution).
Advice for midterm studying
The main topics we've covered since midterm 1 are vectors and functions.
We're also expected to be much more confident with loops and if/else statements this time around.
I'd expect the format to be pretty similar to what you saw on Midterm 1, including:
"C++ trivia" questions - maybe multiple choice or fill in the blank
Maybe "find the mistakes" questions
Reading code and explaining what it will do
Writing short code snippets
Writing 1-2 longer programs
For practice, I'd recommend:
Do the current homework and also the problems I just linked above.
Read my code samples for style / structure guidance.
That includes the hw5 code I posted here
and the solutions for the vector/function problems.
Try solving some coding problems using pencil and paper instead of your computer.
Remember, on the test you'll need to know the syntax
instead of relying on your computer to underline errors!
I'm happy to answer questions by email!
Feel free to ask me conceptual questions, or ask for hints on problems you haven't been able to solve.
In the latter case you should show me your attempt or explain what you've been trying and where you're stuck.