DollarAmount Program
Description
The purpose of this program is to input the purchase amount and cash paid, then calculate the change and figure out the change in quarters, dimes, nickels, and pennies.Associated Concepts:
Division operator / and modulus operator %
Math.round() method
Math.round() method
Algorithm:
Declare variables to store data items
Read data for purchase amount and cash paid
Calculate the change
Use division operator / and modulus operator % to figure out the change in quarters, dimes, nickels, and pennies.
Hint: Use Math.round() method to get the accurate amount
Print the result
Read data for purchase amount and cash paid
Calculate the change
Use division operator / and modulus operator % to figure out the change in quarters, dimes, nickels, and pennies.
Hint: Use Math.round() method to get the accurate amount
Print the result