Not sure what to do with this error

#include <stdio.h>
#include <conio.h>
#include <limits.h>
#include <stdlib.h>

int Code[90];
char Name[90][32];
char BlockBuildingNo[90][10];
char StreetAddress[90][30];
char UnitNumber[90][10];
char PostalCode[90][10];
char Phone[90][12];
int RentalDate[90];
char VIPMember[90][1];
int RentalPeriods[90][1];
int NumberofrentedDVDdiscs[90][1];

double store[5][3]={ { 5,6,7 }, {4.5,5.5,6.5 }, {4,5,6 },{ 3.5,4.5,5.5 },{ 3,4,5 } };



int counter;

int main()
{

char ch;
int NOW=0;
int InputFunction(int x);
int Compute(int x);


void Display();
while(1)
{
int CustomerNumber=0;
printf("BLOCKBUSTER ONLINE DVD RENTAL SYSTEM");
printf("\n");
printf("(A) Customer Rental Input ");
printf("\n");
printf("(B) Computation of Rental & Discount" );
printf("\n");
printf("(C) Display Rental Cost");
printf("\n");
printf("(D) Quit");
printf("\n");
printf(">> Enter Choice: ");

scanf("%c",&ch);

system ( "cls" );
if (ch == 'a' || ch == 'A')
{
NOW=CustomerNumber;
InputFunction(CustomerNumber);
CustomerNumber++;
getch();

}
else if(ch == 'b' || ch == 'B')
{
Compute(NOW);
getch();
}
else if(ch == 'c' || ch == 'C')
{
Display();
getch();
}
else if(ch =='d' || ch == 'D' )
{
break;
}


}
getch();
return 0;



}


int InputFunction(int x)
{

printf("Customer Code:"); //(2 numeric characters: 01-99)
scanf("%d",&Code[x]);

printf("Customer Name:"); //(30 Alpha-numeric characters)
scanf("%s",&Name[x]); //printf("1%s,2%s",Name[0],Name[1]);

printf("Block Building No:"); //(10 Alpha-numeric characters)
scanf("%s",&BlockBuildingNo[x]);//printf("building %s",BlockBuildingNo[0]);

printf("Street Address:"); //(30 Alpha-numeric characters)
scanf("%s",&StreetAddress[x]);

printf("Unit No:"); //(10 Alpha-numeric characters)
scanf("%s",&UnitNumber[x]);

printf("Postal Code:"); //(10 Alpha-numeric characters)
scanf("%s",&PostalCode[x]);

printf("Phone:"); //(12 Alpha-numeric characters)
scanf("%s",&Phone[x]);

printf("Rental Date:"); //(valid range: DD-MM-YYYY)
scanf("%d",&RentalDate[x]);



printf("Rental Periods:"); //(1,3 or 7 days) (valid range: 1, 3, 7)
scanf("%d",&RentalPeriods[x]); /*******************************/
/*******************************/

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");

//************************************************************
//************************************************************
//************************************************************

printf("Customer Code: %d", Code[x]);
printf("\n");
printf("Customer Name: %s", Name[x]);
printf("\n");
printf("Block/Building : %s", BlockBuildingNo[x]);
printf("\n");
printf("Street Address : %s",StreetAddress[x]);
printf("\n");
printf("Unit Number : %s",UnitNumber[x]);
printf("\n");
printf("Postal Code : %s",PostalCode[x]);
printf("\n");
printf("Phone : %s",Phone[x]);
printf("\n");
printf("Unit No : %s",UnitNumber[x]);
printf("\n");
printf("VIP Member (Y/N) : %s", VIPMember[x]);
printf("\n");

printf("Rental Date : %d",RentalDate[x]);
printf("\n");

////////////////////////////////
int i=0,j=0;
double raw=0;
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;
raw = store[i][j]*NumberofrentedDVDdiscs[x][0];
/////////////////////////////////







printf("Rental Days Qty Unit Price(S$) Total Cost(S$)");
printf("\n");
printf("++++++++++++++++++++++++++++++++++++++++++++++++++++++");
printf("\n");
printf(" %d %d $%.2f $%.2f ",RentalPeriods[x][0],NumberofrentedDVDdiscs[x][0],store[i][j],raw );


}












There is this error that says:
'Compute' : must return a value
'Input function' : must return a value

how do i deal with this error :/
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.
Last edited on
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.
Topic archived. No new replies allowed.