Tag: subroutine

Standard Form Conversion Algorithm


Standard form (a.k.a. standard index form), is a system of writing numbers which is particularly useful when using either very large or very small numbers. It is based on using powers of 10 to express how big or small a

Triangle Geometry Functions


In this challenge we will create a library of functions to apply the different formulas based on the geometry of triangles. For each function, you will need to design the algorithm using either Pseudo-code or a flowchart, implement the function

Linear Search Functions


For this programming challenge we will investigate different functions which will all be based on a linear search algorithm. Let’s consider a teacher who has decided to keep track of rewards issued to their students throughout the term by adding

Leap Year Subroutine

A leap year is a calendar year that contains an additional day (29th of February) added to keep the calendar year synchronised with the astronomical year or seasonal year (which contains roughly 365¼ days or 365.242375 days to be more

Graphing Algorithm


In this challenge we will write several procedures to graph different mathematical equations on screen using Python Turtle. We will focus on: Linear equations: y = ax + b Quadratic equations: y = ax2 + bx + c Trigonometric functions:

Connect4 Challenge

Connect4 Data Structure using a 2D-array

In this blog post you will use HTML, CSS, and JavaScript to complete this game of connect 4 for two players. (Rules of the game) You will first need to reverse-engineer the code provided. The code so far is used

Water Polo Challenge


In this challenge you are going to use Python code to score a goal in a game of Water Polo. To do so you will use the code given below. You will pass the ball from one player to another

Football Formation


The purpose of this challenge is to understand how subroutines (functions/procedures) are used in Python to create sections of code that can be called/reused many times within a program. Subroutines mean that a section of code can be identified using

Cinema Booking Challenge

A cinema has created a booking system for their main theatre which consists of 48 seats, organised in 6 rows of 8 seats. To store information as to whether a seat is booked or available, the program uses a 2-dimensional

Professor Snape’s Magic Potions


In this challenge we will use file handling techniques to read through and access the content of different text files. We have saved three recipes for the following three magic potions using one text file per recipe: Invisibility Potion: A