aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch9-Florea-pseudo-code.txt
blob: 0432af4e53372ab6c4d69d6c2048f5f6e06f1118 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
variable DAYS_PER_YEAR = 365

declare function GetAge
declare function CalcDays
declare function PrintResults


function main
    variable age = 0
    variable days = 0

    age = call function GetAge()
    days = call function CalcDays(pass in age)

    call function PrintResults(pass in days, pass in age)

function GetAge
    variable age

    display "Please enter your age"
    take the input and store it in age

    return age

function CalcDays( parameter years (give the variable age))
    variable days

    days = years * DAYS_PER_YEAR

    return days

function PrintResults(parameter days, parameter age)
    display variable age + "! Boy are you old"
    display "Did you know you are at least" + variable days + " days old?"