In this portion of my code the user is entering in 76 numbers. However about 75% of them will be 0. My manager said it would be nice if he could just hit enter and have the number automatically set to 0 rather than having to hit '0' 'Enter'
if (whattodo == 1)
{
cout << "Enter the quantities for each magazine price. \nAfter you enter all the quantities you will have the chance to edit them." << endl;
cout << endl << "***Column 1 Column 1 Column 1***" << endl << endl;
for (i=0; i<76; i++)
{
if (i == 26)
{
cout << endl << "***Column 2 Column 2 Column 2***" << endl << endl;
}
if (i == 51)
{
cout << endl << "***Column 3 Column 3 Column 3***" << endl << endl;
}
cout << "Enter quantity number " << (i+1) << endl;
cout << fixed << setprecision(2) << "RETAIL $" << retail [i] << " Quantity: ";
cin >> q[i];
cout << endl;
}
}
As you can see I've been using cin which doesn't accept whitespace. Is there a function I can use instead of cin? If not, what would be a good way to implement this?