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

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

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

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

Python Turtle – My House

Using Python Turtle we created a range of functions to draw a house. We use these functions in our main program but can’t seem to get it to work. We believe the code has all the required instructions but these

Avatar Generator

In this challenge we will use Python Turtle to create avatars. (An avatar is an icon representing a particular person in a computer game, Internet forum, etc.) Try the code below. This code is using a few computing concepts such