尝试学习C ++

这是我第一次使用C ++,并且我正在尝试学习该语言。我正在编写一个程序,用于计算五种产品的总销售数据。该程序的代码是:

#include <iostream>
#include <iomanip>

using namespace std;

int main ()
{
    int product;
    int sold;
    double price = 0.00;
    double total = 0.00;

    cout <<"Please enter a product number.(Press ctrl+z to end)" <<endl;
    cin >> product;

while ((product = cin.get()) != EOF)
{
switch (product) {

    case '1':
        cout<< "How many were sold?"<<endl;
        cin >> sold;
        price = 2.98;
        total = total + (price * sold);
        cout << "Enter a product number. (Press ctrl+z to end)" << endl;
        break;

    case '2':
        cout<< "How many were sold?"<<endl;
        cin >> sold;
        price = 4.50;
        total = total + (price * sold);
        cout << "Enter a product number. (Press ctrl+z to end)" << endl;
        break;

    case '3':
        cout<< "How many were sold?"<<endl;
        cin >> sold;
        price = 9.98;
        total = total + (price * sold);
        cout << "Enter a product number. (Press ctrl+z to end)" << endl;
        break;

    case '4':
        cout<< "How many were sold?"<<endl;
        cin >> sold;
        price = 4.49;
        total = total + (price * sold);
        cout << "Enter a product number. (Press ctrl+z to end)" << endl;
        break;

    case '5':
        cout<< "How many were sold?"<<endl;
        cin >> sold;
        price = 6.87;
        total = total +(price * sold);
        cout << "Enter a product number. (Press ctrl+z to end)" << endl;
        break;

    case '\n':
    case '\t':
    case ' ':
        break;

    default:
        cout << "Not a valid product number.  Please enter another number.";
            break;
    }

}

cout << "The total value of merchandise sold last week was: " << fixed <<setprecision (2) << total << endl;

return 0;

}

该程序有效,但是要开始使用,我必须输入两次数字。我的代码中是否有引起它执行此操作的过程,或者仅仅是C ++的怪癖。我将不胜感激提供的任何帮助。