OOP : Programming

Seriously need help
since that my work is to
close upon reaching the deadline

in less than 6 more hour's time ... :(






i have this big problem
connecting my header and sourcefiles together...

well,
compiler did not exactly try to debug me in my header
but in my sourcefiles...YES



so...

can anyone please help me out?










- - - - - - - - - - - - - -
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

#include <iostream>

using std::cout;
using std::cin;
using std::endl;

#include "complex.h"



Complex::ComplexNum( int real, int imaginary)
     { setComplexNum ( real, imaginary ); }


void Complex::setComplexNum()
{    
     setComplexNumReal( r );
     setComplexNumImaginary( m );
}


void Complex::SelectCalculation()
{
     int code
     cout << "Enter a code for the calculation to be done: \n"
          << "(add -> 1, substract -> 2, multiply -> 3, square -> 4, or cube -> 5)\n";
     cin >>  code;
     
     if ( code >=1 && code <= 5 )
        cout << "Calculation selected.";
        
        if ( code == 1 )
           cout << ComplexAdd()<< endl;
        if ( code == 2 )
           cout << ComplexSubstract() << endl;
        if ( code == 3 )
           cout << ComplexMultiply() << endl;
        if ( code == 4 )
           cout << ComplexSquare() << endl;
        if ( code == 5 )
           cout << ComplexCube() << endl;
           
     else
        cout << "Invalid code." << endl;
        
     
}


void Complex::ComplexAdd( int r, m, r1, r2, m1, m2 )
{
     r = r1 + r2;
     m = m1 + m2;
}




. . . 

- - - - - - - - - - - - -





this is my sourcefile part
the rest of it is quite similar

if it is my header that you think may have to do the debug
i'll post it on later


:)

And what is your problem exactly?
If you are getting compile errors, then at a minimum you have to post the
error messages themselves and the lines of code / contents of the file in
which the error(s) occur(s).
i'm so sorry
i just thought that the whole is all too much to lay it out :)

the compiler kept on trying to debug line 8:

#include "complex.h" (line 8)

is there something to do with DEV C++?

others say that i need to put my header and sourcefiles in one project
would that make it better?

( confusing...: ( )
It can't find the include file. Make sure the file is in the same folder you have your .exe or you change your search path in Dev's settings.
well, about the problem
i'm trying to allow clients of the class make calculation with complex numbers
including addition, substraction, multiplication, square and cube.

maybe you can give me a general idea as to how the program may be built?

please? :)



although sadly
my work has gone over its deadline
and it didn't go quite as i expected,

but i still want to know how i can run the program requested :)
Topic archived. No new replies allowed.