Section 3 Practice Tasks

Practice Tasks for Calculations

1. Ask the user to enter one number and then another number. Multiply the two numbers together and print the total. Remember you need to input integers. The program could look like this:

calc6

Requirements for full marks:

  • A comment at the start to explain the program.
  • Use both variables in your print line along with the total (like the example picture).

2. Create a program that asks the user to enter a number and then prints the square of that number. For example:

newbs15

Requirements for full marks:

  • A comment at the start.
  • Display the user’s number in your print line.

3. Create a program that asks the user their current age and then prints a guess of when they will turn 65. (Note this is more likely to be correct towards the end of the year – think about why). For example:

newbs16

Requirements for full marks:

  • A comment at the start.
  • Only 3 lines (including comment line).
  • A full sentence printed out.

    4. Isabella is really athletic. She goes to a sports or fitness club once every three days. She needs a tracker to remind her if she is working out today or not.

    Create a program where:

    • The day of the month (e.g. 1 or 15 or 31) is entered.
    • If there is no remainder then she is going to a sports club.
    • Otherwise she can go straight home. 

      Extension: If the day is divisible by 6 then she has hockey, otherwise it’s Yoga.


< Back to Section Three