Hello again, I need help with exercise 3.11 in the book programming: Principles and practice using c++...
the task is to write a program that outputs the amount of pennies, nickels, quarters, halves and dollars that the user has.
I completed the program fine but the second part of the task is to improve the program so that it is grammatically correct e.g if the user has one penny it outputs one penny instead of one pennies... The problem is that when i enter that i have 2 pennies or any other of the values it gives me the singular value after the number e.g you have 2 penny or you have 56 dime... I haven't fully grasped the if and else statements yet so i believe the problem lies within them.
That was spot on vlad, working now! I should have known that im aware of the of the comparison operator... Thanks ! Another quick Question... the third improvement you have to make is to the report the total in dollars for e.g. if the user has 563 cents it should output "You have $5.62 dollars" I'm thinking that every 100 cents = 1 dollar but how would i go about writing this in code? something to do with the modulo operator?