Kodewick
Start learning →
Basic←→0 / 70

Zoo ticket

#016BasicConditions3 min

A zoo ticket costs 20, but children under 6 and people aged 65 or over get in free. Write ZooTicket(age) to return what this visitor pays.

Examples
ZooTicket(4)→0
ZooTicket(30)→20
ZooTicket(70)→0
The functionfunc ZooTicket(age int) int
main.go
package main

func ZooTicket(age int) int {
	// your code here: under 6 or 65 and over? return 0
	return 20
}
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.