Post by Kevin on Nov 15, 2005 18:42:28 GMT
[shadow=red,left,300][/shadow]Here is the question construct a program that will make change from a one-dollar bill on a sale of less than or equal to one dollar. Have the program request the amount of the sale. If the sale amount is less than 1 cent or greater than 100 cents, display a diagnostic message and request that the amount of the sale be re-entered. the program is to display the number of half dollars, quarters, dimes, nickelsa, and pennies that are to be returned tyo the customer. Have the program return as many half dollars as possilbe, then as many quarters as possible,and so on. A sale amount of indicate end-of-job.
Here is my code so far:
CLS
LOOP
PRINT "Money Charger:"
PRINT
PRINT "Enter Amount of sale as a Whole Number"
INPUT "Between 1 Cent and 100 Cent inclusive ====>',sales%
PRINT
IF sales% >= 100 OR sales% > 1 THEN PRINT
PRINT "Please enter an amount between 1 and 100"
PRINT "Enter Amount of sale as a Whole Number"
INPUT "Between 1 Cent and 100 Cent inclusive ====>',sales%
PRINT
IF sales% < 1 THEN
END IF
PRINT
H = sales% \50
Q = INT(1*(sales%-(H* 50))/25
D = INT(100*(sales%-(H* 50))/10)
N = INT(100*(sales%-(H* 85))/5)
P = Sales-90\100
PRINT "Return to the Customer-";H; "Half Dollar(s)"
PRINT " ";Q; "Quarter(s)"
PRINT " ";D; "Dime(s)"
PRINT " ";N; "Nickel(s)"
PRINT " ";P; "Pennies (s)"
PRINT
LOOP
I cant get past this part!!!!
Here is my code so far:
CLS
LOOP
PRINT "Money Charger:"
PRINT "Enter Amount of sale as a Whole Number"
INPUT "Between 1 Cent and 100 Cent inclusive ====>',sales%
IF sales% >= 100 OR sales% > 1 THEN PRINT
PRINT "Please enter an amount between 1 and 100"
PRINT "Enter Amount of sale as a Whole Number"
INPUT "Between 1 Cent and 100 Cent inclusive ====>',sales%
IF sales% < 1 THEN
END IF
H = sales% \50
Q = INT(1*(sales%-(H* 50))/25
D = INT(100*(sales%-(H* 50))/10)
N = INT(100*(sales%-(H* 85))/5)
P = Sales-90\100
PRINT "Return to the Customer-";H; "Half Dollar(s)"
PRINT " ";Q; "Quarter(s)"
PRINT " ";D; "Dime(s)"
PRINT " ";N; "Nickel(s)"
PRINT " ";P; "Pennies (s)"
LOOP
I cant get past this part!!!!