Error 1 Use of unassigned local variable 'rental'
<p>I get the error. The way I am looking at is I want the value that is returned from dayrental() * 19.95 to be stored in rental.  </p>

<p>Use of unassigned local variable 'rental'</p>

<pre><code> private void button1_Click(object sender, EventArgs e)
    {

        double rental;
        if (checkBox1.Checked == true)
            rental = dayrental() * 19.95;
        label4.Text = Convert.ToString(rental);




    }

    private void label4_Click(object sender, EventArgs e)
    {

    }
    public double dayrental()
    {
        var timeSpan = dateTimePicker2.Value - dateTimePicker1.Value;
        var rentalDays = timeSpan.Days;
        return (double) rentalDays;          
        //label4.Text = Convert.ToString(rentalDays);   
    }
</code></pre>
