Error trying to call string variable
<p>I am writing a c++ program that takes user input for car type, days rented, and miles driven, calculates the variables against constant values and produces a report. I have written the code with a if statement that looks at the carType, "f" or "c" entered by the user and performs calculations from that input. The output however needs to show the name of the vehicle, ford or chevrolet not the entered "f" or "c".</p>

<p>I am getting an error while trying to take the letter and equate it to the brand. Also, I am getting headers for each entry made by the user, how can I take 5 entries and output them under one heading?</p>

<p>Here is my code:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;sstream&gt;
#include &lt;iomanip&gt;
#include &lt;cmath&gt;

using namespace std;

int main()
{
    // Change the console's background color.
    system ("color F0");

    // Declare the variables.
    char carType, brand;
    string f("Ford"), c("Chevrolet");
    int counter = 0, cars = 0;
    double days, miles, cost_Day, cost_Miles, day_Total;

    cout &lt;&lt; "Enter the number of cars you wish to enter: ";
    cin &gt;&gt; cars;
    cin.ignore();

    while (counter &lt;= cars)
    {

        cout &lt;&lt; "Enter the car type (F or C): ";
        cin &gt;&gt; carType;
        cin.ignore();
        cout &lt;&lt; "Enter the number of days rented: ";
        cin &gt;&gt; days;
        cin.ignore();
        cout &lt;&lt; "Enter the number of miles driven: ";
        cin &gt;&gt; miles;
        cin.ignore();


        if (carType == 'F' || carType == 'f')
        {
            cost_Day = days * 40;
            cost_Miles = miles * .35;
            day_Total = cost_Miles + cost_Day;
            brand = f;
        }
        else
        {
            cost_Day = days * 35;
            cost_Miles = miles * .29;
            day_Total = cost_Miles + cost_Day;
            brand = c;
        }

        cout &lt;&lt; "\nCar          Days          Miles          Rental Cost\n";
        cout &lt;&lt; left &lt;&lt; setw(13) &lt;&lt; brand &lt;&lt; left &lt;&lt; setw(13) &lt;&lt; days &lt;&lt; left &lt;&lt; setw(13) &lt;&lt; miles 
        &lt;&lt; fixed &lt;&lt; setprecision(2) &lt;&lt; showpoint &lt;&lt; "$" &lt;&lt; setw(13) &lt;&lt; right &lt;&lt; day_Total &lt;&lt; "\n\n";
        counter++;
    }


        system ("pause");
}
</code></pre>

<p>Thanks in advance!</p>
