Hi everyone - I'm new to programming and have been obsessing over this code to calculate the max, min and sum of 3 varibale for 2 days straight but can't figure out why I keep getting compiler errors!! I know it's probably something really simple but if you can please help me I'd really appreciate it!!

errors: calculate_max: local function definitions are illegal
(53) line contains a brace which has not been matched
fatal error: end of file found before the left brace

***************************

#include <iostream>

using namespace std ;

float calculate_min (float a, float b, float c);
float calculate_max (float a, float b, float c);
float sum (float a, float b, float c);
void increaseBy10 (float k, float& result);

int main()
{
float x;
float y;
float z;
float xx;
float yy;
float zz;

float min_number;
float max_number;
float sum_of;

cout << "please input 3 numbers: " << endl;
cin >> x;
cin >> y;
cin >> z;

min_number = calculate_min(x,y,z);
max_number = calculate_max(xx,yy,zz);
sum_of = sum(x,y,z);

increaseBy10( x, xx );
increaseBy10( y, yy );
increaseBy10( z, zz );
cout << endl;

cout << "The lowest value: " << min_number << endl;
cout << "The highest value: " << max_number << endl;
cout << "The total value of the three numbers: " << sum_of << endl;
cout << "The value of the three numbers if each is increased by 10 is listed:" << endl;
cout << " " << xx << endl;
cout << " " << yy << endl;
cout << " " << zz << endl;

return (0);
}

float calculate_min (float x, float y, float z)
{
float min_number;
{
if((x < y) && (x < z))
{
min_number = x;

if ((y < z) && (y < z))
{
min_number = y;

if ((z < x) && (z < y))
{
min_number = z;
}
return min_number;
}

float calculate_max (float x, float y, float z)
{
float max_number;
{
if((x > y) && (x > z))
{
max_number = x;
}
if ((y > z) && (y > z))
{
max_number = y;
}
if ((z > x) && (z > y))
{
max_number = z;
}

return max_number;
}

float sum (float x, float y, float z)
{
float sum;

{

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

using namespace std ;

float calculate_min (float a, float b, float c);
float calculate_max (float a, float b, float c);
float sum (float a, float b, float c);
void  increaseBy10 (float k, float& result);

int main()
{
float x;
float y;
float z;
float xx;
float yy;
float zz;

float min_number;
float max_number;
float sum_of;

cout << "please input 3 numbers: " << endl;
cin >> x;
cin >> y;
cin >> z;

min_number = calculate_min(x,y,z);
max_number = calculate_max(xx,yy,zz);
sum_of     = sum(x,y,z);

increaseBy10( x, xx );
increaseBy10( y, yy );
increaseBy10( z, zz );
cout << endl;

cout << "The lowest value: " << min_number << endl;
cout << "The highest value: " << max_number << endl;
cout << "The total value of the three numbers: " << sum_of << endl;
cout << "The value of the three numbers if each is increased by 10 is listed:" << endl;
cout << " " << xx << endl;
cout << " " << yy << endl;
cout << " " << zz << endl;

return (0);
}

float calculate_min (float x, float y, float z)
{
float min_number;
{
if((x < y) && (x < z))
{
min_number = x;

if ((y < z) && (y < z))
{
min_number = y;

if ((z < x) && (z < y))
{
min_number = z;
}
return min_number;
}

float calculate_max (float x, float y, float z)
{
float max_number;
{
if((x > y) && (x > z))
{
max_number = x;
}
if ((y > z) && (y > z))
{
max_number = y;
}
if ((z > x) && (z > y))
{
max_number = z;
}

return max_number;
}

float sum (float x, float y, float z)
{
float sum;

{```

3. As far as i can see...there are two closing braces missing in calculate_min
Code:
```float calculate_min (float x, float y, float z)
{
float min_number;
{//remove this if u wanna retain them add a  } after return so as to close with correct no of //braces check this for calculate_max also its missing a closing brace
if((x < y) && (x < z))
{
min_number = x;
if ((y < z) && (y < z))
{
min_number = y;
if ((z < x) && (z < y))
{
min_number = z;
}
return min_number;
}```

and one more thing u r passing the wrong parameters to calculate_max while calling....it should not be (xx,yy,zz) it should be (x,y,z)..
i guess this is the program u want
Code:
```#include <iostream>

using namespace std ;

float calculate_min (float a, float b, float c);
float calculate_max (float a, float b, float c);
float sum (float a, float b, float c);
void  increaseBy10 (float k, float *result);

int main()
{
float x;
float y;
float z;
float xx;
float yy;
float zz;

float min_number;
float max_number;
float sum_of;

cout << "please input 3 numbers: " << endl;
cin >> x;
cin >> y;
cin >> z;

min_number = calculate_min(x,y,z);
max_number = calculate_max(x,y,z);
sum_of     = sum(x,y,z);

increaseBy10( x,&xx );
increaseBy10( y,&yy );
increaseBy10( z,&zz );
cout << endl;

cout << "The lowest value: " << min_number << endl;
cout << "The highest value: " << max_number << endl;
cout << "The total value of the three numbers: " << sum_of << endl;
cout << "The value of the three numbers if each is increased by 10 is listed:" << endl;
cout << " " << xx << endl;
cout << " " << yy << endl;
cout << " " << zz << endl;

return (0);
}

float calculate_min (float x, float y, float z)
{
float min_number;
{//unnecessary dont need scoping for a variable in a function..
if((x < y) && (x < z))
{
min_number = x;
}
if ((y < z) && (y < z))
{
min_number = y;
}
if ((z < x) && (z < y))
{
min_number = z;
}
return min_number;
}
}

float calculate_max (float x, float y, float z)
{
float max_number;
{
if((x > y) && (x > z))
{
max_number = x;
}
if ((y > z) && (y > z))
{
max_number = y;
}
if ((z > x) && (z > y))
{
max_number = z;
}

return max_number;
}
}

float sum (float x, float y, float z)
{
float sum;
{
sum=x+y+z;
return sum;
}
}

void  increaseBy10 (float k, float *result)
{
(*result)=k+10;
}```

4. Aside from the missing braces, your sum() function has barely begun.

Also, take a read through this
http://cboard.cprogramming.com/c-pro...t-process.html
Lots of small steps when you're learning - compiling takes seconds at most. Fixing a few lines at a time is a lot easier than fixing a whole new program.

5. Horray!! THANK YOU!! The compiler liked that much better but when I went to run the program, I got 'run time' errors after typing in the 3 numbers...

Debug Error!
Run-Time Check Failure #3 - The variable 'min number' and 'max number' is being used without being initialized

What the heck am I missing? ... besides a well rested brain :/

6. I didn't notice that about the Sum function thanks Salem. I'll definitely check that out the link!

7. Wow, I really need sleep... I just noticed the rest of the first reply.. let me give that a whirl and see if this works! THANK YOU THANK YOU

8. Even after trying the code written in the first reply if u get the run time error...try initialising the min and max variables and recompile the code....

9. sweet jesus it worked! after i initialized the min and max variables and made the other corrections... it compiled w/out errors and ran like a charm!!
i have learned greatly by this experience

thanks again!!