Small Basic Exercise: Counting Garage Sale Money

Eve’s mom is running a garage sale. Eve wants to earn some money, so she sets up a table to sell lemonade, cookies, and her homemade greeting cards as the customers come up the driveway (she’s cute, so she sells a lot).

Help Eve count the money her customers give her by creating a program that converts the number of dollars, quarters, dimes, nickels, and pennies entered by a user and then converts them into a total dollar amount (try it with these amounts to make sure it works):

35 dollars, 3 quarters, 3 pennies

2 dollars, 1 quarter, 2 pennies

10 dollars, 1 nickel, 3 pennies

6 dollars, 1 quarter, 3 pennies

3 dollars, 2 quarters, 1 dime, 1 nickel, 3 pennies

1 dollar, 2 dimes, 1 nickel, 4 pennies

Next, see if you can personalize your program for Eve. Eve really exists (she's my daughter).

Leave a comment to share your program with Eve!

 

Have a Small and Basic day!

    - Ninja Ed