Category: Challenges

Byte Insight

Dog Year Calculator

A dog that is 5 Years old is equivalent to a 42 year old human.

The human equivalent age is calcuated using the following method:

  • The user inputs the age of the dog in years
  • If the age is 2 or less, the human equivalent is 12 times the age.
  • If the age is more than 2, the human equivalent is 24 for the first 2 years plus 6 for every additional year.

Write a program that converts the age of a dog to the equivalent for a human.

Magic 8 Ball

The Magic 8 Ball is a toy used for fortune-telling or seeking advice, manufactured by Mattel and developed in the 1950s.  It is often used in fiction, often for humour related to it giving very accurate, very inaccurate, or otherwise statistically improbable answers. You must design and write a program that recreates the Magic 8 Ball experience.

Film Society

A film society has over 300 members who are able to borrow from its library of more than 1000 classic films. There is more than one copy of some films. The films may be held in video cassette form, DVD form, or, in some cases, both.

Members pay an annual membership fee that allows them to borrow films free of charge. Members can only have one film out on loan at a time. Loans are not permitted to extend beyond seven days.

The film society needs a database to contain details of its members, its films and those films currently out on loan.

Cellular Automata

Complex behaviour arises out of very simple rules. Here’s a simple set of rules for your “ant” to follow that makes an interesting display. 1. If the ant is on a black square, it turns right 90° and moves forward one unit. 2. If the ant is on a white square, it turns left 90° and moves forward one unit. 3. When the ant leaves a square, it inverts the color.

Etch A Sketch


This challenge is taken from © The Coding Club Python books written by Chris Roffey, which serve as an excellent introduction to Python for younger age groups. The challenge is simple.   Write a Etch A Sketch program that recreates the popular 70s/80s Etch A Sketch toy.

Sith 2006

This is an algorithm trace task. No implementation is required.

Read the following algorithm, which operates on numbers held in an array Sift, where the size of the array is 10. All of the variables used in the algorithm are integers.

In the algorithm, DIV is an operator that divides one integer by a second integer and truncates the result to its integer part. This means that

  • 15 DIV 4 is 3
  • 19 DIV 2 is 9

Curiosity 2006

This is an algorithm trace task. No implementation is required.

Read the following algorithm for the recursive function called Curiosity that needs two integers as inputs and returns an integer value.

In the algorithm, MOD is an operator. It works with two integers to give the remainder when the first integer is divided by the second. This means that

  • 17 MOD 7 is 3
  • 72 MOD 15 is 12

Press Cutting Service

This is a software development task and an implementation task.

A group of Sixth Form students have decided to run a press cutting service for the students in their school. They intend to identify and take cuttings of topics related to each examination subject taught at the school.

They propose to hold basic information about each cutting on a database. Students will be able to access this database.

Examination Centre

This is an algorithm trace task. No implementation is required.

Read the algorithm below, which validates an Examination Centre number and determines whether it is an overseas or a UK Centre.

The function Len(code) returns the number of characters in code. For example, if code = JA3451,
Len(code) = 6.

The algorithm refers to the one dimensional array err, which has been dimensioned to five cells.

Each output starts on a new line.

Push Pop

This is an algorithm trace task. No implementation is required.

The following algorithm uses one procedure and five functions.