Imagine that you have just landed that dream job of yours in the local hamburger joint. Your…
Imagine that you have just landed that dream job of yours in the local hamburger joint. Your first assignment is to write a program that figures out what change to make if a person buys one item that costs less than a dollar and pays for it with a dollar bill or coin.
a. Compute what change in quarters, dimes, and pennies you would give, using the minimum number of coins. Hint: Work entirely in integer arithmetic and define the integers: price, change, quarters, dimes, and pennies. To name an instance, 27 cents would be represented by the integer 27, and change = 100 – price, quarters = change/25, etc.
b. Modify the program so that it uses floating-point variables and comment on the different results.