aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch9-Debugging/CST116-Ch9-Debugging-Preston-Pseduocode.txt
blob: 0dd3c0a93a424f264fcd5ac6dfc128d98d8ed362 (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
35
36
Pseudocode for Ch9 Debugging

constant int daysperyear = 365

function getage
function calcdays(age)
void function printresults(age, days)

main function begin
	int age = 0
	int days = 0

	age = getage

	days = calcdays(age)

	printresults(age, days)

getage function begin
	int age

	print "Please enter your age: "
	input age

	return age

calcdays function begin (int years)
	int days

	days = years * daysperyear

	return days

printresults function begin
	print age + "! Boy you are old!" *new line
	print "Did you know that you are at least " + days + " days old?" *new line