Can this if-else statement be made cleaner
<p>I am trying to improve a C++ assignment to make it more efficient.  I am a beginner with the language (and programming in general too), so I am only using what I know so far (if, else).  I have a function that converts scores into levels, so anything under 30 = 1, 30-49 = 2, 50-79 = 3 and so on...</p>

<p>Here is how I am doing it:</p>

<pre><code>if (score1 &lt;= 30) level1 = 1;
else if (score1 &lt;= 49) level1 = 2;
else level1 = 3;

if (score2 &lt;= 30) level2 = 1;
else if (score2 &lt;= 49) level2 = 2;
else level2 = 3;

//etc...
</code></pre>

<p>Is there a better way to do this, as I am aware this will require a new line for every single score I have.</p>
