Hi,
for some reason the function "AREAOFSQUARE" is not being called correctly. it gives me this error: "error C2064: term does not evaluate to a function taking 1 arguements."Code:#include <iostream> #include <string> #include <cmath> #include <fstream> #include <iomanip> using namespace std; int main() { int OPTION= 99; while(OPTION !=0 ) { int MENU(); int SIDE; double AREAOFSQUARE; 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; }
I looked at examples in my book and the tutorials, but i can not find what i am doing wrong.



LinkBack URL
About LinkBacks


