Function declarations needed. Either globally or locally to main.
Code:
int main()
{
int MENU(void);
double AREAOFSQUARE(double);
int OPTION= 99;
while(OPTION !=0 )
{
int SIDE;
OPTION=MENU();
if (OPTION == 1)
{
cout<<"Enter the length of the side";
cin>>SIDE;
cout<<"The area of the square is: "<<AREAOFSQUARE(SIDE)<<endl;
}
else
cout<<"..."<<endl;
}
}
int MENU()
{
int CHOICE;
cout<<"1.) Compute area of a square."<<endl;
cout<<"Select one."<<endl;
cin>>CHOICE;
return CHOICE;
}
double AREAOFSQUARE(double SIDE)
{
return SIDE * SIDE;
}
Code:
#include <iostream>
#include <string>
#include <cmath>
#include <fstream>
#include <iomanip>
using namespace std;
double AREAOFSQUARE(double);
int MENU(void);
int main()
{
int OPTION= 99;
while(OPTION !=0 )
{
int SIDE;
OPTION=MENU();
if (OPTION == 1)
{
cout<<"Enter the length of the side";
cin>>SIDE;
cout<<"The area of the square is: "<<AREAOFSQUARE(SIDE)<<endl;
}
else
cout<<"..."<<endl;
}
}
int MENU()
{
int CHOICE;
cout<<"1.) Compute area of a square."<<endl;
cout<<"Select one."<<endl;
cin>>CHOICE;
return CHOICE;
}
double AREAOFSQUARE(double SIDE)
{
return SIDE * SIDE;
}