How old will you be in…

calendar-clockIn this challenge we will write a Python program to help us find out hold we will be in the coming years! We have designed the algorithm of our program using both a Flowchart and Pseudocode.

Algorithm

FlowchartPseudocode
how-old-flowchart

Reviewing the Algorithm


Check the above pseudo-code and answer the following questions:


?
What variables are used in this code?


?
On what line is iteration used?


?
What value is used to initialise the variable year?


?
On what line is the variable age incremented?


?
On which line is string concatenation used?


?
How many lines will be displayed on screen once this program has been fully executed?


?
What would be the last line to appear on screen once this program has been fully executed?

Check the above flowchart and answer the following questions:


?
In a flowchart, what shape is used to represent a user INPUT?


?
In a flowchart, what shape is used to represent iteration?


?
In a flowchart, what shape is used to represent an OUTPUT?

Python Code


Your task is to use the algorithm provided below (either Flowchart or Pseudo-code) to code this algorithm using Python.

Share Button
Posted in Computer Science, Python - Beginner, Python Challenges Tagged with: , ,

Our Latest Book

Follow this blog