User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 423,566 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,624 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 167 | Replies: 5
Join Date: May 2008
Posts: 16
Reputation: mertucci is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mertucci mertucci is offline Offline
Newbie Poster

help me please I try to make a arithmetic calculator but i have 3 errors

  #1  
May 15th, 2008
function is x/y+z means (x/y)+z
if you dont write to Z anything
program says "ERROR: Operator-operand imbalance."
program is that as it is above

and my code is
#include <iostream>
using namespace std;
class Calculator
{
      int x,y,z;
      public:
             void arith_ex(int,int,int);
      };
      
      void Calculator::arith_ex(int x,int y,int z)
      {
               cout<<"X="<<endl;
               cin>>x;
               cout<<"Y="<<endl;
               cin>>y;
               cout<<"Z="<<endl;
               cin>>z;
               if(z==' ')
               {cout<<"ERROR: Operator-operand imbalance."<<endl;
               }
           cout<<"Sonuc="<<x/y+z<<endl;
           }
    
        
           
           int main()
           {
               Calculator hesap;
               
               hesap.arith_ex(int x,int y ,int z); //expected primary expression before 'int'//
              
               return 0;
               }


ERRORS--> error C2144: syntax error : missing ')' before type 'int'
error C2660: 'arith_ex' : function does not take 0 parameters
error C2059: syntax error : ')'
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the C++ Forum

All times are GMT -4. The time now is 6:44 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC