You are on page 1of 2

start calculateAge(month,year)

declarations
currentMonth=4
declarations
currentYear=2023
num numMonth=0
num numYear=0
num month=int(input(Please enter birth month: "))
num year=int(input("Please enter birth year: "))

Yes
if month<=currentMonth: age=currentYear-year

output
month

No

output age=currentYear-year-1
year

calculateAge(month,year)

return age

output
("current age is: ", str(calculateAge(month,year)))
start
declarations
num numMonth=0
num numYear=0
num month=int(input("Please enter birth month: "))
num year=int(input("Please enter birth year: "))
output month
output year
calculateAge(month,year)
output (current age is : ", str(calculateAge(month,year)))
stop
calculateAge(month,year):
declarations
currentMonth=4
currentYear=2023
if month<=currentMonth:
age=currentYear-year
else:
age=currentYear-year-1
endif
return age

You might also like