Вызов метода Check

Как можно вызвать метод из класса Recalculation, который проверяет количество товара и снижает цену?

#include <iostream>
using namespace std;
class Product
{
public:
double* Cost;
int *Quantity;
Product(double c, int q)
{
    Cost = new double(c);
    Quantity = new int(q);
};
~Product()
{
    delete Cost, Quantity;
};
virtual void PrintInfo()
{
}
virtual void PriceForBulkPurchase()
{
}
};
class Recalculation: public Product
{
public:
Recalculation();
void Check(Product *type)
{
    if (*Quantity > 1000)
    {
        *Cost = *Cost / (5 * 4);
        cout << "Цена уменьшена" << endl;
    }
}
};
class Processor :public Product
{
public:
Processor(double c, int q) : Product(c, q)
{
    Cost = new double(c);
    Quantity = new int(q);
}
~Processor()
{
    delete Cost, Quantity;
}
void PrintInfo()
{
    cout << "Количество процессоров: " << *Cost << endl;
    cout << "Цена процессора: " << *Quantity << endl;
    cout << "Стоимость всего товара: " << *Cost * *Quantity << endl;
}
void PriceForBulkPurchase()
{
    double sale = 7;
    cout << "Цена покупки оптом (скидка 7%): " << (*Cost**Quantity) - (*Cost * (sale / 100) * 
*Quantity) << endl;
}
};
class GraphicsCard :public Product
{
public:
GraphicsCard(double c, int q) : Product(c, q)
{
    Cost = new double(c);
    Quantity = new int(q);
}
~GraphicsCard()
{
    delete Cost, Quantity;
}
void PrintInfo()
{
    cout << "Количество видеокарт: " << *Cost << endl;
    cout << "Цена видеокарты: " << *Quantity << endl;
    cout << "Стоимость всего товара: " << *Cost * *Quantity << endl;
}
void PriceForBulkPurchase()
{
    double sale = 13;
    cout << "Цена покупки оптом (скидка 13%): " << (*Cost * *Quantity) - (*Cost * (sale / 100) * 
*Quantity) << endl;
}
};
class HDD :public Product
{
public:
HDD(double c, int q) : Product(c, q)
{
    Cost = new double(c);
    Quantity = new int(q);
}
~HDD()
{
    delete Cost, Quantity;
}
void PrintInfo()
{
    cout << "Количество дисков: " << *Cost << endl;
    cout << "Цена диска: " << *Quantity << endl;
    cout << "Стоимость всего товара: " << *Cost * *Quantity << endl;
}
void PriceForBulkPurchase()
{
    double sale = 10;
    cout << "Цена покупки оптом (скидка 10%): " << (*Cost * *Quantity) - (*Cost * (sale / 100) * 
*Quantity) << endl;
}
};
int main()
{
setlocale(LC_ALL, "rus");
Recalculation x;
Product* type = NULL;
Processor p(50, 100);
GraphicsCard gc(100, 68);
HDD hd(250, 1100);
while (true)
{
    cout << "1 – Процессоры" << endl;
    cout << "2 – Видеокарты" << endl;
    cout << "3 – Диски" << endl;
    cout << "4 – Выход" << endl;
    int k;
    cin >> k;
    switch (k)
    {
    case 1:
    {
        type = &p; 
        break;
    }
    case 2:
    {
        type = &gc;
        break;
    }
    case 3:
    {
        type = &hd;
        break;
    }
    case 4:
    {
        exit(0);
    }
    default:
        cout <<  "Выберите правильно!" << endl;
        break;
    }
    type->PrintInfo();
    type->PriceForBulkPurchase();
    x.Check(type);
}
}

Ответы (0 шт):