Skip to main content

INF1B - top navigation

  • Learn
  • Piazza
  • DRPS

Breadcrumb

  1. Home
  2. INF1B: Informatics 1 - Object Oriented Programming
  3. INF1B: Schedule

INF1B: Week 2: Arrays; Functions

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.

License
Creative Commons - Attribution Share A Like

Book traversal links for INF1B: Week 2: Arrays; Functions

  • INF1B: Week 1: Intro and Basics; Conditionals and Loops
  • Up
  • INF1B: Week 3: Classes and Objects; Testing and Debugging

Navigation links

  • INF1B: Getting Started: setting up the tools you will need for this course
  • INF1B: Resource List
  • INF1B: Schedule
    • INF1B: Week 1: Intro and Basics; Conditionals and Loops
    • INF1B: Week 2: Arrays; Functions
    • INF1B: Week 3: Classes and Objects; Testing and Debugging
    • INF1B: Week 4: Java API; Collections
    • INF1B: Week 5: Stack vs Heap; Abstraction and Modularisation
    • INF1B: Week 6: Creating classes; Refactoring
    • INF1B: Week 7: Inheritance
    • INF1B: Week 8: More Inheritance plus time for assignment
    • INF1B: Week 9: Abstract Classes and Interfaces; Object Design
    • INF1B: Week 10: Version Control
    • INF1B: Week 11: Catch-up Week
  • INF1B: Assessment
  • INF1B: Tutorials
  • INF1B: Labs
  • INF1B: Labs Site
RSS feed

Opencourse privacy & accessibility statements; contact Informatics, ILTS.