printf("VIP Member:"); //(valid values: Y, y, N, n)
scanf("%s",&VIPMember[x]);
printf("Number of rented DVD discs:"); //(valid range: 1 - 5)
scanf("%d",&NumberofrentedDVDdiscs[x]);
}
int Compute(int x)
{
int i=0;
int j=0;
double raw=0;
//rmb x is not the customer code, is the address to store the customer code.
printf("Your Customer Code: %d",Code[x]);
printf("\n");
printf("Number of discs you rent: %d",NumberofrentedDVDdiscs[x][0]);
printf("\n");
printf("Rental Periods: %d",RentalPeriods[x][0]);
printf("\n");
if(RentalPeriods[x][0]==1)
{
j=0;
}
else if(RentalPeriods[x][0]==3)
{
j=1;
}
else if(RentalPeriods[x][0]==7)
{
j=2;
}
i=NumberofrentedDVDdiscs[x][0]-1;
printf("Rental Price for a disc: $%.2f",store[i][j]);
printf("\n");
raw = store[i][j]*NumberofrentedDVDdiscs[x][0];
printf("Price before deducting VIP/OFFER:$%.2f",raw);
printf("\n");
if(VIPMember[x][0]=='Y' || VIPMember[x][0]=='y' )
{
printf("Price after deducting VIP discount:$%.2f",raw*0.9);
printf("\n");
}
else if(raw>20 && (VIPMember[x][0]=='N' || VIPMember[x][0]=='n') )
{
printf("price after deducting non-VIP discount:$%.2f",raw*0.9);
}
else if(raw>15 && raw<20 && (VIPMember[x][0]=='N' || VIPMember[x][0]=='n'))
{
printf("price after deducting non-VIP discount:$%.2f",raw*0.95);
}
}
void Display()
{
int Store=0,x=0;
printf("Enter the Customer Code:");
scanf("%d",&Store);
for(;x<90;x++)
{
if(Code[x]==Store)
{
break;
}
}
printf("The code is store at array address is %d",x);
printf("\n");
Please use code tags next time, so that it's easier for us to tell you which line to work on.
On the line (whichever on it is) where you declare your compute() function, you gave it a return type of int, change it to void and you're set.
From your code it seems there is a lot of confusion regarding function paramters. You may want to refresh it by studying the tutorial on this website. http://www.cplusplus.com/doc/tutorial/functions/
For instance you are declaring Compute and InputFunction as:
int Compute(int x);
and
int InputFunction(int x);
This simply means that each function takes an input of type int as parameter and returns a value of type int. You are not returning any value in your present code. If you do not want them to return anything, declare them as:
void Compute(int x);
and
void InputFunction(int x);
and while calling, you have to give them a valid int input so that these functions can process it accordingly.