Times tables

Times tables

A times tables reference sheet.

The 1-12 times tables are something you learn when you are young. This program outputs a handy reference sheet for a times table.

Make


Write a program to output the times table between one and twelve for a number.

Use this boilerplate code as a starting point:

Success Criteria

Remember to add a comment before a subprogram, selection or iteration statement to explain its purpose.

Complete the subprogram called `times_table` that:

  1. Takes a parameter `x` which is the times table to be output.
  2. Outputs the times table of x between 1 and 12.

Complete the `main program` so that:

  1. The user can input the times table they want to output.
  2. It calls the `times_table` subprogram.

Typical inputs and outputs from the program would be:

Which table do you want to output? 1-12 :3

1 x 3 = 3

2 x 3 = 6

3 x 3 = 9

4 x 3 = 12

5 x 3 = 15

6 x 3 = 18

7 x 3 = 21

8 x 3 = 24

9 x 3 = 27

10 x 3 = 30

11 x 3 = 33

12 x 3 = 36

Knowledge Organiser

Use these resources as a reference to help you meet the success criteria.

Programming guide:

Evaluate


Run the unit tests below to check that your program has met the success criteria.

Which table do you want to output? 1-12 :6

1 x 6 = 6

2 x 6 = 12

3 x 6 = 18

4 x 6 = 24

5 x 6 = 30

6 x 6 = 36

7 x 6 = 42

8 x 6 = 48

9 x 6 = 54

10 x 6 = 60

11 x 6 = 66

12 x 6 = 72

Which table do you want to output? 1-12 :12

1 x 12 = 12

2 x 12 = 24

3 x 12 = 36

4 x 12 = 48

5 x 12 = 60

6 x 12 = 72

7 x 12 = 84

8 x 12 = 96

9 x 12 = 108

10 x 12 = 120

11 x 12 = 132

12 x 12 = 144

Check that you have:

  • Used comments within the code to describe the purpose of subprograms, conditions and iterations.
  • Used meaningful identifier names. That means the names of subprograms and variables indicate what they are for.