1. smiles are caused
Code:
`:D`
code-tags can help also

2. simplify2(x,GCD(w, x)) << endl;

fuction int simplify2 - missing closing } in the function body

3. I fixed thboth of those but I still get errors.

Code:
```Info :Compiling C:\DOCUMENTS AND SETTINGS\LABPC\DESKTOP\fraction hoskins beta v2.cpp
Error:  fraction hoskins beta v2.cpp(39,5):Declaration syntax error
Error:  fraction hoskins beta v2.cpp(40,8):Declaration terminated incorrectly
Error:  fraction hoskins beta v2.cpp(47,3):Unexpected }```

4. Cool, no smilys.

5. could you fix your indentetion and post a last code
also pointing the lines containing errors (with comments) will help

6. Here is the new code.

Code:
```#include <iostream.h>

int GCD(int a, int b )
{
int remainder, quotient, divisor, numerator;
if (a > b)
{
remainder=a%b;
quotient=a/b; divisor=b;
}
else
{
remainder=b%a;
quotient=b/a;divisor=a;
}
}

while( remainder!=0 )   //error 1
{
numerator=divisor;
divisor=quotient;
remainder=numerator%divisor;
quotient=numerator/divisor;
}
return divisor;

} //error2

int simplify1(int a, int GCD )
{
int product1;
{
do
{
product1=a / GCD;
}
while ( a!=0);
}
return product1;
}

int simplify2(int b, int GCD )

int product2;  //error3
{ //error4
do
{
product2=b / GCD;
}
while ( b!=0 );
}

return product2;
} //error5

int main()
{
int w, x;
char junk;

cout << "This program allows calculating the GCD\n";
cout << "Value of first numerator: ";
cin >> w;
cout << "Value of first denominator: ";
cin >> x;

cout << "\nThe Greatest Common Divisor of "
<< w << " and " << x << " is " << GCD(w, x) << endl;
cout << "\nThe simplified fraction is "
<< w << " and " << x << simplify1(w,GCD(w, x)) << " and "<<
simplify2(x,GCD(w, x)) << endl;

cin >> junk; //This input allows for display.

return 0;
}```
and here are the errors
Code:
```Info :Compiling C:\Documents and Settings\labpc\Desktop\fraction hoskins beta v2.cpp
Warn :  fraction hoskins beta v2.cpp(16,2):Function should return a value
Warn :  fraction hoskins beta v2.cpp(16,2):'numerator' is declared but never used
Warn :  fraction hoskins beta v2.cpp(16,2):'divisor' is assigned a value that is never used
Warn :  fraction hoskins beta v2.cpp(16,2):'quotient' is assigned a value that is never used
Warn :  fraction hoskins beta v2.cpp(16,2):'remainder' is assigned a value that is never used
Error:  fraction hoskins beta v2.cpp(18,8):Declaration terminated incorrectly
Error:  fraction hoskins beta v2.cpp(27,2):Unexpected }
Error:  fraction hoskins beta v2.cpp(44,5):Declaration syntax error
Error:  fraction hoskins beta v2.cpp(45,8):Declaration terminated incorrectly
Error:  fraction hoskins beta v2.cpp(54,3):Unexpected }```

7. wow, my indentation really does suck. sorry.

8. you have to many closing } in the GCD function

9. this is the new code.

Code:
```#include <iostream.h>

int GCD(int a, int b )
{
int remainder, quotient, divisor, numerator;
if (a > b)
{
remainder=a%b;
quotient=a/b; divisor=b;
}
else
{
remainder=b%a;
quotient=b/a;divisor=a;
}

while( remainder!=0 )
{
numerator=divisor;
divisor=quotient;
remainder=numerator%divisor;
quotient=numerator/divisor;
}
return divisor;

}

int simplify1(int a, int GCD )
{
int product1;
{
do
{
product1=a / GCD;
}
while ( a!=0);
}
return product1;
}

int simplify2(int b, int GCD )

int product2;      // error 1
{       // error 2
do
{
product2=b / GCD;
}
while ( b!=0 );
}

return product2;

int main()
{
int w, x;
char junk;

cout << "This program allows calculating the GCD\n";
cout << "Value of first numerator: ";
cin >> w;
cout << "Value of first denominator: ";
cin >> x;

cout << "\nThe Greatest Common Divisor of "
<< w << " and " << x << " is " << GCD(w, x) << endl;
cout << "\nThe simplified fraction is "
<< w << " and " << x << simplify1(w,GCD(w, x)) << " and "<<
simplify2(x,GCD(w, x)) << endl;

cin >> junk; //This input allows for display.

return 0;
}```
and here is the errors

Code:
```Info :Compiling C:\Documents and Settings\labpc\Desktop\fraction hoskins beta v2.cpp
Error:  fraction hoskins beta v2.cpp(44,5):Declaration syntax error
Error:  fraction hoskins beta v2.cpp(45,8):Declaration terminated incorrectly```

10. Code:
```int simplify2(int b, int GCD )
{
int product2;      // error 1
{       // error 2
do
{
product2=b / GCD;
}
while ( b!=0 );
}

return product2;
}```

11. Alright, I fixed that.

I got an email from the teacher. He wants us to add two fractions together and simplify now. if he keeps adding stuff to our assignments we will never get it done.

12. Code:
```#include <iostream.h>

int GCD(int a, int b )
{
int remainder, quotient, divisor, numerator;
if (a > b)
{
remainder=a%b;
quotient=a/b; divisor=b;
}
else
{
remainder=b%a;
quotient=b/a;divisor=a;
}

while( remainder!=0 )
{
numerator=divisor;
divisor=quotient;
remainder=numerator%divisor;
quotient=numerator/divisor;
}
return divisor;

}

int simplify(int a, int GCD )
{
int product;
{
//do
{
product=a / GCD;
}
//while ( a!=0);
}
return product;
}
/*
int simplify1(int a, int GCD )
{
int product1;
{
do
{
product1=a / GCD;
}
while ( a!=0);
}
return product1;
}

int simplify2(int b, int GCD )
{
int product2;      // error 1
// error 2
do
{
product2=b / GCD;
}
while ( b!=0 );

return product2;
}  */

int main()
{
int w, x,y,z;
char junk;

cout << "This program allows calculating the GCD\n";
cout << "Value of first numerator: ";
cin >> w;
cout << "Value of first denominator: ";
cin >> x;
cout << "Value of second numerator: ";
cin >> y;
cout << "Value of second denominator: ";
cin >> z;

cout << "\nThe Greatest Common Divisor of "
<< w << " and " << x << " is " << GCD(w, x) << endl;
cout << "\nThe simplified fraction is "
<< w << " and " << x << simplify(w,GCD(w, x)) << " and "<<
simplify(x,GCD(w, x)) << endl;

cin >> junk; //This input allows for display.

return 0;
}```

13. Code:
```do
{
product1=a / GCD;
} while ( a!=0);```
a is not changed inside the loop
so if the condition was true in the beginning - it will be true ever
so the loop will be endless

14. here is the new code

Code:
```#include <iostream.h>

int GCD(int a, int b )
{
int remainder, quotient, divisor, numerator;
if (a > b)
{
remainder=a%b;
quotient=a/b; divisor=b;
}
else
{
remainder=b%a;
quotient=b/a;divisor=a;
}

while( remainder!=0 )
{
numerator=divisor;
divisor=quotient;
remainder=numerator%divisor;
quotient=numerator/divisor;
}
return divisor;

}

int simplify(int a, int GCD )
{
int product;
{
{
product=a / GCD;
}
}
return product;
}

int main()
{
int w, x,y,z;
char junk;

cout << "This program allows calculating the GCD\n";
cout << "Value of first numerator: ";
cin >> w;
cout << "Value of first denominator: ";
cin >> x;
cout << "Value of second numerator: ";
cin >> y;
cout << "Value of second denominator: ";
cin >> z;

cout << "\nThe Greatest Common Divisor of "
<< w << " and " << x << " is " << GCD(w, x) << endl;
cout << "\nThe simplified fraction of "
<< w << " and " << x << " is " << simplify(w,GCD(w, x)) << " and "<<
simplify(x,GCD(w, x)) << endl;

cin >> junk; //This input allows for display.

return 0;
}```

15. is it working?
seems to be ok, except the indentation and to many unnecacery breckets...

also GCD(w,x) is calculated 3 times - you can calculate it once and store in the temporary varyable.