C++ error: expected primary-expression before 'int'?
<p>update: 
so I was able to compile and run the program and it seems to work! However, the variable for judge score value 2.3 - stores in an odd fashion and is throwing off the calculation. when i enter 2.3, the store value is 2.299999999998 - why is this? The calcScore or lowest and highest functions may be at error because the final score is off by 0.3 when entering scores, 2.3 - 5.5 - 5.5 - 5.5 - 8.5 - Any ideas?</p>

<pre><code>// file name starSearch.cpp
// author: SK
// last modified: 03/19/2012

#include &lt;iostream&gt; 
#include &lt;iomanip&gt;
using namespace std;

//function prototypes
void getJudgeData(double &amp;);
void calcScore(double, double, double, double, double);
int findLowest(double, double, double, double, double);
int findHighest(double, double, double, double, double);

//declare variables
double score1;
double score2;
double score3;
double score4;
double score5;

int main()
{
    getJudgeData(score1); //Call getJudgeData for first judge score
    getJudgeData(score2); //Call getJudgeData for second judge score
    getJudgeData(score3); //Call getJudgeData for third judge score 
    getJudgeData(score4); //Call getJudgeData for fourth judge score
    getJudgeData(score5); //Call getJudgeData for fifth judge score
    calcScore(score1, score2, score3, score4, score5);    //calculate contestant score
    return 0; 
}

//
//Begin funtion prototypes definitions
//

//defines calcScore.
void calcScore(double score1, double score2, double score3, double score4, double score5)
{
    double total = (score1 + score2 + score3 + score4 + score5 - findLowest(score1, score2, score3, score4, score5) - findHighest(score1, score2, score3, score4, score5)) / 3;
    cout &lt;&lt; setprecision(2);
    cout &lt;&lt; "The contestant's final score is: " &lt;&lt; total &lt;&lt; endl;
}

//defines getJudgeData. this function asks each judge for their score.
void getJudgeData(double &amp;score)
{
    cout &lt;&lt; "Judge, enter the contestant's score: ";
    cin &gt;&gt; score;
    if (score &lt; 0 || score &gt; 10) //validate score between 0-10, else display error msg
    {
    cout &lt;&lt; "ERROR: Enter a value in the range 0-10.\n";
    return getJudgeData(score);
    }
    return;
}

//defines findLowest. this function returns the lowest score entered.
int findLowest(double score1, double score2, double score3, double score4, double score5)
{
    if (score1 &lt; score2 &amp;&amp; score1 &lt; score3 &amp;&amp; score1 &lt; score4 &amp;&amp; score1 &lt; score5)
    {
        return score1;
    }

    else if (score2 &lt; score1 &amp;&amp; score2 &lt; score3 &amp;&amp; score2 &lt; score4 &amp;&amp; score2 &lt; score5)
    {   
        return score2;
    }

    else if (score3 &lt; score1 &amp;&amp; score3 &lt; score2 &amp;&amp; score3 &lt; score4 &amp;&amp; score3 &lt; score5)
    {
        return score3;
    }

    else if (score4 &lt; score1 &amp;&amp; score4 &lt; score2 &amp;&amp; score4 &lt; score3 &amp;&amp; score4 &lt; score5)
    {
        return score4;
    }

    else if (score5 &lt; score1 &amp;&amp; score5 &lt; score2 &amp;&amp; score5 &lt; score3 &amp;&amp; score5 &lt; score4)
    {
        return score5;
    }
}

//defines findHighest. this functio returns the highest score entered.
int findHighest(double score1, double score2, double score3, double score4, double score5)
{
    if (score1 &gt; score2 &amp;&amp; score1 &gt; score3 &amp;&amp; score1 &gt; score4 &amp;&amp; score1 &gt; score5)
    {
        return score1;
    }

    else if (score2 &gt; score1 &amp;&amp; score2 &gt; score3 &amp;&amp; score3 &gt; score4 &amp;&amp; score3 &gt; score5)
    {   
        return score2;
    }

    else if (score3 &gt; score1 &amp;&amp; score3 &gt; score2 &amp;&amp; score3 &gt; score4 &amp;&amp; score3 &gt; score5)
    {
        return score3;
    }

    else if (score4 &gt; score1 &amp;&amp; score4 &gt; score2 &amp;&amp; score4 &gt; score3 &amp;&amp; score4 &gt; score5)
    {
        return score4;
    }

    else if (score5 &gt; score1 &amp;&amp; score5 &gt; score2 &amp;&amp; score5 &gt; score3 &amp;&amp; score5 &gt; score4)
    {
        return score5;
    }
}
</code></pre>

<p>ORIGINAL:</p>

<p>I am getting the compiler error on line 39 where my algebra expression is written with the integer 3. I just cant figure out how to average the five scores and remove the lowest and highest. the functions to determine which is highest and lowest seem to be in order though.. Please help.</p>

<p>Thank you.</p>

<pre><code>*// file name starSearch.cpp
// author: SK
// last modified: 03/19/2012

#include &lt;iostream&gt; 
using namespace std;

//function prototypes
void getJudgeData(double);
void calcScore();
int findLowest();
int findHighest();

//declare variables
double score1;
double score2;
double score3;
double score4;
double score5;

int main()
{
    getJudgeData(score1); //Call getJudgeData for first judge score
    getJudgeData(score2); //Call getJudgeData for second judge score
    getJudgeData(score3); //Call getJudgeData for third judge score 
    getJudgeData(score4); //Call getJudgeData for fourth judge score
    getJudgeData(score5); //Call getJudgeData for fifth judge score
    calcScore();    //calculate contestant score
    return 0; 
}

//
//Begin funtion prototypes definitions
//

//defines calcScore.
void calcScore(double score1, double score2, double score3, double score4, double score5)
{
    double total = score1 + score2 + score3 + score4 + score5 - int findLowest(a, b, c, d, e) - intfindHighest(a, b, c, d, e) / 3;
    cout &lt;&lt; "The contestant's final score is: " &lt;&lt; total &lt;&lt; endl;
}

//defines getJudgeData. this function asks each judge for their score.
void getJudgeData(double score)
{
    cout &lt;&lt; "Judge, enter the contestant's score: ";
    cin &gt;&gt; score;
    if (score &lt; 0 || score &gt; 10) //validate score between 0-10, else display error msg
    {
    cout &lt;&lt; "ERROR: Enter a value in the range 0-10: ";
    cin &gt;&gt; score;
    }
    else
    return;
}

//defines findLowest. this function returns the lowest score entered.
int findLowest(double score1, double score2, double score3, double score4, double score5)
{
    if (score1 &lt; score2, score3, score4, score5)
    {
        return score1;
    }

    else if (score2 &lt; score1, score3, score4, score5)
    {   
        return score2;
    }

    else if (score3 &lt; score1, score2, score4, score5)
    {
        return score3;
    }

    else if (score4 &lt; score1, score2, score3, score5)
    {
        return score4;
    }

    else if (score5 &lt; score1, score2, score3, score4)
    {
        return score5;
    }
}

//defines findHighest. this functio returns the highest score entered.
int findHighest(double score1, double score2, double score3, double score4, double score5)
{
    if (score1 &gt; score2, score3, score4, score5)
    {
        return score1;
    }

    else if (score2 &gt; score1, score3, score4, score5)
    {   
        return score2;
    }

    else if (score3 &gt; score1, score2, score4, score5)
    {
        return score3;
    }

    else if (score4 &gt; score1, score2, score3, score5)
    {
        return score4;
    }

    else if (score5 &gt; score1, score2, score3, score4)
    {
        return score5;
    }
}*
</code></pre>
