Week Highlights
By the end of this week, you should understand:
- From lecture 3:
- What arrays are
- How to declare, create and initialise an array
- Shorthand syntax for initialising arrays
- What vector dot products are
- How to create two-dimensional arrays
- Matrix addition and multiplication
- What enhanced for loops are
- From lecture 4:
- Why functions are important
- Five benefits of splitting programs into functions
- The anatomy of a java function
- How functions control the flow of execution in a program
- How pass by value works
- What the signature of a java function is
- How breaking a complex process down into discrete steps can simplify coding
Lecture 3: Arrays
- Slides: 03-arrays.pdf
Lecture 3 ➡ Java Tutorial:
- Come back to Chapter 3. Language Basics, section on Variables and read subsection on Arrays.
Lecture 4: Functions
- Slides: 04-functions.pdf
Lecture 4 ➡ Java Tutorial:
- Read the first two sections of Chapter 2 Object-Oriented Programming Concepts carefully now, but stop at Inheritance.
- Read the first part of Chapter 4 Classes and Objects, stopping at Objects.
Tutorial: Pair Programming
This week will have some introductory exercises and look at pair programming.
- Instructions: Tutorial1.pdf
- Solutions: Tutorial1_solutions.pdf
You don't need to prepare for the tutorial in advance. The exercises are made to be done in groups during the tutorial session. If you are unsure about anything, feel free to ask on Piazza.
The tutorials are not assessed so solutions are available too. However, you will learn the most if you attempt the exercises yourself first -- don't be tempted to just read the solutions. If you're stuck on an exercise, but don't want the full solution, you can ask for a hint on Piazza.
Lab exercises
This week's lab exercises cover Boolean expressions, conditionals and loops. There are four warmup exercises, five core exercises, and three optional exercises for this week.
What should I be doing with the assignment?
Don't worry about it, the first assignment will be released next week.