(I skiped some parts ,since it can't be displayed)
function ticket(age)
{var result
if ( age >= 18 ){result=10}
else{result=8}
return result}
const gstRate = 0.06
var pstRate = 0
var gst, pst, ticketCost, totalCost, age,ticket
pstRate = inputNum("PST rate ", 0.08)
age = inputNum("How old are you", 18)
ticketCost = ticket(age)
gst = ticketCost * gstRate
pst = ticketCost * pstRate
totalCost = ticketCost + gst + pst
2006-11-02 01:00:49 · 1 個解答 · 發問者 Anita 1 in 電腦與網際網路 ➔ 程式設計
What is the problem?
It is supposed to return totalCost=11.40
Perhaps your problem is elsewhere.
2006-11-02 03:40:41 · answer #1 · answered by p 6 · 0⤊ 0⤋