Starting from:

$25

CPSC121-Lab 1 Solved

Create a program that:

1.     Asks the user to input a number of cents

2.     Calculates and displays the number of quarters, dimes, nickels, and pennies that should be used to reach the value. EX: 67 cents would be 2 quarters, 1 dime, 1 nickel, and 2 pennies

3.     Calculates and display the total number of coins to be given back, ie 6 coins for above

Hint: The simplest way to solve this involves using the division (/) operator and modulus (%) operator. It helps to use the int data type!

More products