Problem with my looping?

Not sure whats going on, this program lets me consistantly put input in witout outputting anything.
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;

int main()
{
double numCars, numDays, numMiles, user, charge;
char carType;

cout << "How many cars have been rented?";
cin >> numCars;
cout << "Now please input the type of car that was rented\n (using only the beginning letter of the \n";
cout << "type of car, the number of days they had the car,\n and how many miles they put on the car.\n";
cout << setw(8) << "Car Type" << setw(17) << "Number of days" << setw(18) << "Number of Miles" << setw(8) << "Charge\n";
user = 0;

while (user < numCars)
cin >> carType >> numDays >> numMiles;
if (carType == 's' || carType == 'S')
{

charge = (28.0 * numDays) + (numMiles * .29);
cout << setw(8) << "Saturn" << setw(17) << numDays << setw(18) << numMiles << setw(8) << charge << endl;
user++;
}
else
{
charge = (40.0 * numDays) + (numMiles * .35);
cout << setw(8) << "Ford" << setw(17) << numDays << setw(18) << numMiles << setw(8) << charge << endl;
user++;
}



return 0;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;

int main()
{
	double numCars, numDays, numMiles, user, charge;
	char carType;

	cout << "How many cars have been rented?";
	cin >> numCars;
	cout << "Now please input the type of car that was rented\n (using only the beginning letter of the \n";
	cout << "type of car, the number of days they had the car,\n and how many miles they put on the car.\n";
	cout << setw(8) << "Car Type" << setw(17) << "Number of days" << setw(18) << "Number of Miles" << setw(8) << "Charge\n";
	user = 0;

	while (user < numCars) 
	{
		cin >> carType >> numDays >> numMiles;

		if (carType == 's' || carType == 'S')
		{

		charge = (28.0 * numDays) + (numMiles * .29);
		cout << setw(8) << "Saturn" << setw(17) << numDays << setw(18) << numMiles << setw(8) << charge << endl;
		user++;
		}
		else
		{
		charge = (40.0 * numDays) + (numMiles * .35);
		cout << setw(8) << "Ford" << setw(17) << numDays << setw(18) << numMiles << setw(8) << charge << endl;
		user++;
		}
	}
	return 0;
}
Me too!
thank you for your help
have a good day
Topic archived. No new replies allowed.