I've just started to write this program to learn modularity, but I already know I'm going to have trouble writing it. I'm asked to write a function named totamt() that accepts four integer arguments named quarters, dimes, nickels, and pennies in a piggybank. The function should determine and return the dollar value of the number of quarters, dimes, nickels, and pennies past through it.
In the program so far I have:
#include <stdio.h>
int main()
{
void totamt(int,int,int,int);//the function prototype
int quarters,dimes,nickels,pennies;//declares values as integers
printf("Enter the number of quarters: \n");
scanf("%d",&quarters);
printf("Enter the number of dimes: \n");
scanf("%d",&dimes);
printf("Enter the number of nickels: \n");
scanf("%d",&nickels);
printf("Enter the number of pennies: \n");
scanf("%d",&pennies);
I'm currently rereading the chapter Modularity Using Functions: Part 1 so I'll be able to comprehend the material better to write this program. Also, for this program will I need to use function stubs.