Getting a run time error for C++ project
<p>I have to write a program for a C++ class and I am having a bit of trouble. I have gone through all my variables and I feel like I initialized everything, but its still not working. </p>

<p>Program parameters: Calculate electrical bill. Customer gets charged $0.27 a kwh up to 500 kwh, then is charged at an extra rate of $0.57 a kwh thereafter.</p>

<p><em>Input: kwh</em></p>

<p><em>output: Total customer bill</em></p>

<p>Code:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;iomanip&gt;
using namespace std;

int main()
{
    //List the variables
    double kwh;
    double baseKwh;
    double extraKwh;
    double baseBill;
    double extraBill;
    double electricBill;

    //User inputs the kwh used
    cout &lt;&lt; "Enter kwh used: "; //Prompt
    cin &gt;&gt; kwh;

    //Process the data and compute the bill
    if (kwh &lt;= 500) {
    baseKwh = kwh;
    extraBill = 0;

    }
    else {
    baseKwh = 500;
    extraKwh = kwh - 500;
    }
    baseBill = baseKwh * 0.27;
    extraBill = extraKwh * 0.55;
    electricBill = baseBill + extraBill;

    //Output the bill.
    cout &lt;&lt; "Your bill is $" &lt;&lt; electricBill &lt;&lt; endl;

    system("PAUSE");
    return 0;
}
</code></pre>

<p>problem: </p>

<blockquote>
  <p>Run-Time Check Failure #3 - The variable 'extraKwh' is being used
  without being initialized.</p>
</blockquote>

<p>Microsoft Visual Studio points to line 30 as the problem. The program works fine when the user inputs above 500, however, when the user inputs 500 or below then I get the error message.</p>