Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ — error with number of arguments
    primarykey
    data
    text
    <p>I can't seem to get my code to compile - this is the error I'm getting: </p> <p><strong>6\problem11.cpp(21): error C2660: 'calcScore' : function does not take 0 arguments</strong></p> <p>Any help or suggestions in solving this? This is a homework problem and I can't seem to figure out how to fix the error. We're not allowed to use arrays just yet. </p> <pre><code>#include &lt;iostream&gt; using namespace std; void getJudgeData(int); void calcScore(float, float, float, float, float); float findHighest(float, float, float, float, float); float findLowest(float, float, float, float, float); int main() { getJudgeData(1); getJudgeData(2); getJudgeData(3); getJudgeData(4); getJudgeData(5); calcScore(); system("pause"); return 0; } void getJudgeData(int jnumber) { float score1, score2, score3, score4, score5; switch(jnumber) { case 1: cout &lt;&lt; "\nEnter the score for judge " &lt;&lt; jnumber &lt;&lt; ". "; cin &gt;&gt; score1; break; case 2: cout &lt;&lt; "\nEnter the score for judge " &lt;&lt; jnumber &lt;&lt; ". "; cin &gt;&gt; score2; break; case 3: cout &lt;&lt; "\nEnter the score for judge " &lt;&lt; jnumber &lt;&lt; ". "; cin &gt;&gt; score3; break; case 4: cout &lt;&lt; "\nEnter the score for judge " &lt;&lt; jnumber &lt;&lt; ". "; cin &gt;&gt; score4; break; case 5: cout &lt;&lt; "\nEnter the score for judge " &lt;&lt; jnumber &lt;&lt; ". "; cin &gt;&gt; score5; break; calcScore(score1, score2, score3, score4, score5); } } void calcScore(float one, float two, float three, float four, float five) { float high, low, avg; high = findHighest(one, two, three, four, five); low = findLowest(one, two, three, four, five); avg = ((one + two + three + four + five) - (high+low))/3; cout &lt;&lt; "Final score is: " &lt;&lt; avg &lt;&lt;endl; return; } float findHighest(float high1, float high2, float high3, float high4, float high5) // find highest score { float high = 10; if (high1 &gt; high) { high1 = high; } else if ( high2 &gt; high) { high2 = high; } else if ( high3 &gt; high) { high3 = high; } else if (high4 &gt; high) { high4 = high; } else if ( high5 &gt; high) { high5 = high; } return high; } float findLowest (float low1, float low2, float low3, float low4, float low5) // find lowest score { float low = 1; if (low1 &lt; low) { low1 = low; } else if (low2 &lt; low) { low2 = low; } else if (low3 &lt; low) { low3 = low; } else if (low4 &lt; low) { low4 = low; } else if (low5 &lt; low) { low5 = low; } return low; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload