Explore BrainMass

Explore BrainMass

    C+ programming functions program

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Write a C function named change() that accepts a floating point number and the addresses of the integer variables named quarters, dimes, nickels, and pennies. The function should determine the number of quarters, dimes, nickels, and pennies in the number passed to it and write these values directly into respective variables declared in its calling function.

    © BrainMass Inc. brainmass.com November 24, 2022, 11:35 am ad1c9bdddf

    Solution Preview

    You will have to make this code compile and run, but all the basic ideas are here and explained below.
    <br>void change(
    <br> float amountNeedingChange, //this is the input dollars to be changed
    <br> int *pNQuarters, // pointer to output number of quarters
    <br> int *pNDimes, // pointer to output number of dimes
    <br> int *pNNickels, //pointer to output number of nickels
    <br> int *pNPennies //point to output number of pennies
    <br> )
    <br> {
    <br> int remainder; //this is the amount left over ...

    Solution Summary

    C+ programming functions program is modeled.