First I want to say that this is a homework assignment I am working on. However, I do not wish anyone to complete the entire assignment for me. I am just confused on some error messages that I am receiving with my code. I would greatly appreciate any advice on how to simply correct the error messages. Here is the code.
Code:
/*
Assignment 6
Aaron Woods
*/
#include <stdio.h>
#define CALL1 1.88
#define CALL2 0.32
int main ()
{
void change(double, int, int, int, int);
int quarters, dimes, nickels, pennies;
double value;
change();
printf("TOTAL VALUE ENTERED %f", value);
printf("%d quarters", quarters);
printf("%d dimes", dimes);
printf("%d nickels", nickels);
printf("%d pennies", pennies);
return 0;
}
void change()
{
static int num;
double value;
int quarters, dimes, nickels, pennies, count, i;
if (num = 0)
{
value = CALL1;
while (value >= .25)
{
quarters++;
value = value - 0.25;
}
while (value >= 0.1)
{
dimes++;
value = value - 0.1;
}
while (value >= 0.05)
{
nickels++;
value = value - 0.05;
}
while (value >= 0.01)
{
pennies++;
value = value - 0.01;
}
num++;
}
else if (num = 1)
{
value = CALL2;
while (value >= .25)
{
quarters++;
value = value - 0.25;
}
while (value >= 0.1)
{
dimes++;
value = value - 0.1;
}
while (value >= 0.05)
{
nickels++;
value = value - 0.05;
}
while (value >= 0.01)
{
pennies++;
value = value - 0.01;
}
num++;
}
else if (num = 2)
{
printf("Please enter the amount of money\n");
printf("you would like a breakdown of coins for: ");
scanf("%f", &value);
while (value >= .25)
{
quarters++;
value = value - 0.25;
}
while (value >= 0.1)
{
dimes++;
value = value - 0.1;
}
while (value >= 0.05)
{
nickels++;
value = value - 0.05;
}
while (value >= 0.01)
{
pennies++;
value = value - 0.01;
}
num++;
}
}
Here are the error messages I am receiving.
Code:
C:\Users\Aaron Woods\Documents\School Work\C Programming\Assignment 6\Assignment 6.c||In function 'main':|
C:\Users\Aaron Woods\Documents\School Work\C Programming\Assignment 6\Assignment 6.c|16|error: too few arguments to function 'change'|
C:\Users\Aaron Woods\Documents\School Work\C Programming\Assignment 6\Assignment 6.c||In function 'change':|
C:\Users\Aaron Woods\Documents\School Work\C Programming\Assignment 6\Assignment 6.c|29|error: number of arguments doesn't match prototype|
C:\Users\Aaron Woods\Documents\School Work\C Programming\Assignment 6\Assignment 6.c|12|error: prototype declaration|
||=== Build finished: 3 errors, 0 warnings ===|
I apologize for the length. Again I would greatly appreciate any assistance. I am very amateur with C. I am in my first class for it in college.
Thanks
Aaron