Error C2064

Hi there. As you probably will see, I'm new, and my english is not the best... But, getting to my problem right away, I'm stuck in a compiling error C2064, in a program that I was supposed to do in the class laboratory hours ago, and wich, obviously, I haven't finished yet. The code is a bit long (for posting it here, I think), but reads like this:

#include<iostream>
#include<cmath>
using namespace::std;
/* Laboratory #4
Abiezer Reyes Concepcion
#55950
reyes.abiezer@gmail.com
reyes_55950@students.pupr.edu
*/
/* This program makes different
processes and calculations,
depending on the selection of the user*/

/* UNFINISHED VERSION*/

void main()
{
const double pi=3.141592,A=16.5362,B=3985.44,C=-38.9974,press_base=2.7182;
int option,trig,n,d,expn,expd,exp_module;
double r,root,base,number,exp,angle,radian,sine,cosine,tangent,cotangent,cosecant,secant,T,press,exponent,form;
do//Loop Cicle
{
cout<<"\t\tSelect an Option: "<<endl;
cout<<"\t1)Square Root"<<endl;
cout<<"\t2)Power"<<endl;
cout<<"\t3)Trigonometric"<<endl;
cout<<"\t4)Vapor Pressure"<<endl;
cout<<"\t5)Exit"<<endl;
cout<<"Give your selection: ";
cin>>option;
switch(option)
{
case 1://Square Root
do
{
cout<<"Enter the number: ";
cin>>r;
if(r<=0)//Validation of positive number
{
cout<<"ERROR. INVALID NUMBER"<<endl;
}
}while(r<=0);
root=sqrt(r);
cout<<"The square root of "<<r<<" is: "<<root<<endl;
break;//End Square root

case 2://Power Case
do
{
cout<<"Enter the number to elevate. If it is a fraction, enter 1.";
cin>>base;
if(base==1)//Fractional Base
{
cout<<"Enter the numerator: ";
cin>>n;
do
{
cout<<"Enter the denominator: ";
cin>>d;
if(d<=0)
{
cout<<"ERROR. INVALID DENOMINATOR"<<endl;
}
}while(d<=0);
base=n/d;
}//End Fractional Base

do//Exponent
{
cout<<"Enter the exponent. If it is a fraction, enter 1.";
cin>>exp;
if(exp==1)//Fractional Exponent
{
cout<<"Enter the numerator: ";
cin>>expn;
do//Exponent's Denominator
{
cout<<"Enter the denominator: ";
cin>>expd;
if(expd==0)
{
cout<<"ERROR. INVALID DENOMINATOR"<<endl;
}
}while(expd==0);
exp_module=expd%2;
exp=expn/expd;
}//End Fractional Exponent
if(exp==0)
{
cout<<"ERROR. EXPONENT = 0."<<endl;
}
}while(exp==0);//End Exponent

if((base<0) && (exp_module=1))//Negative base & fractional exponent cheking
{
cout<<"Can't use that exponent with a negative base."<<endl;
}//End cheking
else break;
}while((base<0) && (exp_module=1));
number=pow(base,exp);
cout<<"Your result is: "<<number<<endl;
break;//End Power case

case 3://Trigonometrics
do
{
cout<<"\tSelect 1 for sine"<<endl;
cout<<"\tSelect 2 for cosine"<<endl;
cout<<"\tSelect 3 for tangent"<<endl;
cout<<"\tSelect 4 for cotangent"<<endl;
cout<<"\tSelect 5 for secant"<<endl;
cout<<"\tSelect 6 for cosecant"<<endl;
cout<<"\tSelect 7 to exit trigonometric functions"<<endl;
cout<<"Give your selection: ";
cin>>trig;
switch(trig)
{
case 1://Sine
do//Correct angle loop
{
cout<<"Enter the angle, in degrees, from 0 to 360: ";
cin>>angle;
if(angle==0 && angle==180 && angle==360)//Validation of sine existence
{
cout<<"ERROR. SINE DOESN'T EXISTS."<<endl;
}//End validation
}while(angle==0 && angle==180 && angle==360);//End correct angle loop
radian=angle*(pi/180);
sine=sin(radian);
cout<<"The sine of "<<angle<<" is: "<<sine<<endl;
break;

case 2://Cosine
do//Correct angle loop
{
cout<<"Enter the angle, in degrees, from 0 to 360: ";
cin>>angle;
if(angle==90 && angle==270)//Validation of cosine existence
{
cout<<"ERROR. COSINE DOESN'T EXISTS."<<endl;
}//End validation
}while(angle==90 && angle==270);//End correct angle loop
radian=angle*(pi/180);
cosine=cos(radian);
cout<<"The cosine of "<<angle<<" is: "<<cosine<<endl;
break;

case 3://Tangent
do//Correct angle loop
{
cout<<"Enter the angle, in degrees, from 0 to 360: ";
cin>>angle;
if(angle==90 && angle==270)//Validation of tangent existence
{
cout<<"ERROR. TANGENT DOESN'T EXISTS."<<endl;
}//End validation
}while(angle==90 && angle==270);//End correct angle loop
radian=angle*(pi/180);
tangent=tan(radian);
cout<<"The tangent of "<<angle<<" is: "<<tangent<<endl;
break;

case 4://Cotangent
do//Correct angle loop
{
cout<<"Enter the angle, in degrees, from 0 to 360: ";
cin>>angle;
if(angle==90 && angle==270)//Validation of cotangent existence
{
cout<<"ERROR. COTANGENT DOESN'T EXISTS."<<endl;
}//End validation
}while(angle==90 && angle==270);//End correct angle loop
radian=angle*(pi/180);
cotangent=1/cos(radian);
cout<<"The cotangent of "<<angle<<" is: "<<cotangent<<endl;
break;

case 5://Secant
do//Correct angle loop
{
cout<<"Enter the angle, in degrees, from 0 to 360: ";
cin>>angle;
if(angle==90 && angle==270)//Validation of secant existence
{
cout<<"ERROR. SECANT DOESN'T EXISTS."<<endl;
}//End validation
}while(angle==90 && angle==270);//End correct angle loop
radian=angle*(pi/180);
secant=1/cos(radian);
cout<<"The secant of "<<angle<<" is: "<<secant<<endl;
break;

case 6:
do//Correct angle loop
{
cout<<"Enter the angle, in degrees, from 0 to 360: ";
cin>>angle;
if(angle==0 && angle==180 && angle==360)//Validation of cosecant existence
{
cout<<"ERROR. COSECANT DOESN'T EXISTS."<<endl;
}//End validation
}while(angle==0 && angle==180 && angle==360);//End correct angle loop
radian=angle*(pi/180);
cosecant=1/sin(radian);
cout<<"The cosecant of "<<angle<<" is: "<<cosecant<<endl;
break;

default:
cout<<"WRONG SELECTION"<<endl;
break;
}//End trigonometric functions
}while(trig!=7);
break;//End Trigonometrics

case 4://Vapor pressure
cout<<"Enter the temperature: ";
cin>>T;
form=A-(B/(T+C));
exponent=exp(form);
press=pow(press_base,exponent);
cout<<"Your result is: "<<press<<endl;
break;//End Vapor pressure

default:
cout<<"WRONG SELECTION"<<endl;
break;
}//End Switch
}while(option!=5);//End Loop
}//End Main


The error reads like this: "error C2064: term does not evaluate to a function taking 1 arguments", and it is positioned in the Case 4 line, which it is bold and italic.

I hope someone could help me with this problem, which can cost me a 0/100! Thanks!
Last edited on
You declared exp as a double around the 3rd/4th line of main(), so the compiler does not think exp is a function, but you are using it as if it were.

A million thanks!!! I'm amazed how I read many tutorials and problems solving of this same type of error, and looked over and over again my code, and never find anything!!! I'm now correcting a mistake that gives me, in Case 2, some results=0, but I think I can handle it. Thanks Again!!
Last edited on
Topic archived. No new replies allowed.