Text: I need help debugging. Joyce Farrell's, Programming Design and
Logic 8th Edition, Chapter 9.
// Program gets two numbers and computes their product
start
Declarations
num firstNumber
num secondNumber
output "Input first number >> "
input firstNumber
output "Input second number >> "
input secondNumber
computeProduct()
stop
string computeProduct(num first, num second)
Declarations
num answer
answer = first * second
output first, " times ", second, " is ", answer
return
Good Times Party Supplies rents tables and chairs for parties. A set of tables and chairs is $16 each if 12 or fewer sets are ordered and $13 each if 13 or more are ordered. Orders delivered more than 4 miles away require an additional $10 delivery charge. This program accepts the quantity of table sets ordered and the distance to the party and then calculates and displays the total price.
calculateRate(num m, num q)
Declarations
num CUTOFF = 12
num LOW_PRICE = 13.00
num HIGH_PRICE = 16.00
num price
start
No
Yes
q > CUTOFF?
Declarations
num quantity
num miles
price = q * HIGH_PRICE
price = q * LOW_PRICE
output "Enter number of table sets needed"
output "price: " price
input quantity
return
output "Enter distance in miles"
input miles
calculateRate(quantity, miles)
stop