Ok. Before I keep on with this, I figure I should show the other program I had.
This one works and I thought did what he wanted it to do, but I guess not.
Code:
#include "stdio.h"
#include "conio.h"
int value,rem,bill_50,bill_20,bill_10;
void dispenser();
int main(void)
{
printf("**Welcome**\n\n");
dispenser();
getch();
}
void dispenser()
{
int a,b;
printf ("Enter the amount you wish to withdrawl\n");
scanf("%d",&value);
if(((value%10)==0) && (value>0))
{
//Calculates 50s
if(value>=50)
{
bill_50 = value/50;
value = value%50;
printf ("No of 50 Bills is %d \n",bill_50);
}
//Calculates 20s
if((value>=20) && (value<50))
{
bill_20 = value/20;
value = value%20;
printf ("No of 20 Bills is %d \n",bill_20);
}
//Calculates 10s
if(value==10)
{
bill_10 = 1;
value = value%10;
printf ("No of 10 Bills is %d \n",bill_10);
}
printf("Press 1 for a new transaction and 0 to exit\n");
scanf("%d",&a);
if(a == 1)
{
dispenser();
}
if(a == 0)
{
printf("Thank you!!");
exit(0);
}
}
/*Safety for increments of 10*/
else
{
printf ("Please Enter in Multiples 10 only, thank you \n\n");
dispenser();
}
}
I thought it was fine, but this is what he told me.
"does not meet problem specification to compute number of bills in a function, returning all three to main as reference parameters"
That's why I brought up the reference parameters. I thought the program was fine, but there must be something I'm missing that he wants.
And yes, he is a crazy ridiculous bastard.