Write a program that allows someone to enter how many nickels and pennies they have, and then
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a program that allows someone to enter how many nickels and pennies they have, and then returns the total value of the change in dollars and cents.
So, your prompt to the user would look something like this (bold values are the values entered by the user):
Enter the number of nickels: 30
Enter the number of pennies: 77
Your output would look something like this (bold values would be the variable values for final output):
The total value of your coins is 2 dollars and 27 cents
Hint: the modulus operator (%)(pg 40) is used to figure remainders of integer values. a cent (or cents) is a remainder left over when dividing to calculate dollars. Also check the Programming example "Convert Length" on page 91 in your textbook; should help a bit!
Related Book For
Posted Date: