Hi, I have an issue with this coding assigment... I have already done everything possible to make it good but I am not getting the output that I should get. This is what I have done so far but I'm yielding different results. The assignment is supposed to be in Coral Programming form. integer money integer pennies integer dollars integer quarters integer dimes integer nickels integer penny integer dollar integer dime integer nickel integer quarter penny = 1 pennies = 2 dollar = 1 dollars = 2 quarter = 1 quarters = 2 dime = 1 dimes = 2 nickel = 1 nickel = 2 money = Get next input if money <= 0 Put "No change" to output nickels = money / 5 if nickels > 0 and money > 0 money = money - (nickels * 5) if nickels == 1 Put "nickel\n" to output elseif nickels > 1 Put "nickels\n" to output pennies = money / 1 if pennies > 0 and money > 0 money = money - (pennies * 1) if pennies == 1 Put "penny\n" to output elseif pennies > 1 Put "pennies\n" to output dimes = money / 10 if dimes > 0 and money > 0 money = money - (dimes * 10) if dimes == 1 Put "dime\n" to output elseif dimes > 1 Put "dimes\n" to output quarters = money / 25 if quarters > 0 and money > 0 money = money - (quarters * 25) if quarters == 1 Put "quarter\n" to output elseif quarters > 1 Put "quarter\n" to output dollars = money / 100 if dollars > 0 and money > 0 money = money - (dollars * 100) if dollars == 1 Put "dollar\n" to output elseif dollars > 1 Put "dollars\n" to output
Hi, I have an issue with this coding assigment... I have already done everything possible to make it good but I am not getting the output that I should get.
This is what I have done so far but I'm yielding different results. The assignment is supposed to be in Coral
integer money
integer pennies
integer dollars
integer quarters
integer dimes
integer nickels
integer penny
integer dollar
integer dime
integer nickel
integer quarter
penny = 1
pennies = 2
dollar = 1
dollars = 2
quarter = 1
quarters = 2
dime = 1
dimes = 2
nickel = 1
nickel = 2
money = Get next input
if money <= 0
Put "No change" to output
nickels = money / 5
if nickels > 0 and money > 0
money = money - (nickels * 5)
if nickels == 1
Put "nickel\n" to output
elseif nickels > 1
Put "nickels\n" to output
pennies = money / 1
if pennies > 0 and money > 0
money = money - (pennies * 1)
if pennies == 1
Put "penny\n" to output
elseif pennies > 1
Put "pennies\n" to output
dimes = money / 10
if dimes > 0 and money > 0
money = money - (dimes * 10)
if dimes == 1
Put "dime\n" to output
elseif dimes > 1
Put "dimes\n" to output
quarters = money / 25
if quarters > 0 and money > 0
money = money - (quarters * 25)
if quarters == 1
Put "quarter\n" to output
elseif quarters > 1
Put "quarter\n" to output
dollars = money / 100
if dollars > 0 and money > 0
money = money - (dollars * 100)
if dollars == 1
Put "dollar\n" to output
elseif dollars > 1
Put "dollars\n" to output


Step by step
Solved in 3 steps with 5 images









