Question
Write a program that takes as input any change expressed in cents. It should then compute the number of half-dollars, quarters, dimes, nickels, and pennies to be returned. Return as many half-dollars as possible, then quarters, dimes, nickels and pennies to be returned, Return as many half-dollars as possible, then quarters, dimes, nickels, and pennies, in that order. Do this for 100 case scenarios. Please use an array of struts, functions and files. Also use secure coding techniques that you have learned thus far.
Explanation / Answer
struct change {int half_dollar; int quarter; int dimes; int nickels; int penny; } int main() { change c; int cents; coutcents; c.halfdollar=cents/50 cents= cents%50; c.quarter=cents/25; cents=cents%25; c.dimes=cents/10; cents=cents%10; c.nickels=cents/5; cents=cents%5; c.penny=cents; cout