Skip to content

Instantly share code, notes, and snippets.

Let's consider the code that solves the Bulls & Cows problem. What can we learn from it?

Task

Create a four digit random number from the digits 1 to 9, without duplication.

The program should:

  • ask for guesses to this number
  • reject guesses that are malformed

Git & GitHub Homework

Local

  • Create a folder in your week_01/day_1 directory
mkdir precourse_recap
cd precourse_recap

React: Film Releases

Reading

Thinking In React (20 mins)

Practice

You task is to plan and build an application that displays a list of upcoming film titles, each one linking to their imdb page.

// Create a file called part_1_exercises.js and paste in this code:
/* -------------------------------------------------------------
EXERCISE 1
When we run our code, it's not obvious to us what's going on.
That's why we use console.log! It means we can 'log out' values
to the terminal so we can see them.
You can run your code after each exercise from the terminal by typing
the command "node part_1_exercises.js"
-------------------------------------------------------------- */
@StevenMeiklejohn
StevenMeiklejohn / classes_lab.md
Created November 14, 2022 11:35
classes_lab.md

Classes Lab

In this lab, we'd like you to make some classes of your own. Below we've outlined a few scenarios to be modelled as classes.

We have provided a set of files where you can create your classes and test your code.

Learning Objectives

  • Be able to create your own class
  • Be able to create objects

Git & GitHub Homework

Local

  • Create a folder in your week_01/day_1 directory
mkdir precourse_recap
cd precourse_recap

Inheritance Lab.

Your task is to model and create a system to store information for employees of a large development company. You should use TDD, inheritance, packages and abstract classes for this.

Create an abstract Employee parent class in a package called staff.

  • Employee will have a name, NI number and salary.
  • Create Getters for all properties.
  • Add a method named raiseSalary with takes in a parameter of type double to increment the salary.
  • Add a method called payBonus which returns 1% of the employees salary.

Coding Experience (Taster Session) - Building a Full Stack Application in 2 Hours

Lesson Duration: 60 + 60 minutes

Note to instructors: Read these notes once or twice and then just use them as visual clues. You'll need to use some of your own metaphors and explaining style

Intro

LEARNING GOALS: > - Know what programming is: metaphor of a TV program

# Lab: One To Many and Many to Many
**Lab Duration: 90 minutes**
### Learning Objectives
- Understand the relationships, one to many and many to many.
- Be able to implement one-to-many and many-to-many relationships between models with Spring JPA + Hibernate
## Introduction

Control Flow/Conditionals Lab

Lab Duration: 30 minutes

Learning Objectives

  • Practice translating a flowchart into code
  • Practice pseudocode
  • Practice conditional logic

Write a Python program based on the following flowchart.