so close one error left!!!!!!!

when i compile it say
"store.cpp: In function `void sellProducts(std::vector<Product, std::allocator<Product> >&)':
store.cpp:185: error: expected primary-expression before "int"
store.cpp: In function `void restockProducts(std::vector<Product, std::allocator<Product> >&)':
store.cpp:204: error: expected primary-expression before "int""

the code is :

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
using namespace std;

class Product {
public:
Product();
Product(string newName, double newPrice, int getQuantity);
string getName() const;
double getPrice() const;
double getQuantity() const;
void setName(string newName);
void setPrice(double newPrice);
void setQuantity(int newQuantity);
double getValue() const;
void print()const;
void read();

private:
string name;
double price;
int quantity;
};

Product::Product() {
name = "Unknown";
price = 0.0;
quantity = 0;
}

Product::Product(string newName, double newPrice, int getQuantity) {
name = newName;
price = newPrice;
quantity = getQuantity;
}

string Product::getName() const {
return name;
}

double Product::getPrice() const {
return price;
}

double Product::getQuantity() const {
return quantity;
}

void Product::setName(string newName) {
name = newName;
}

void Product::setPrice(double newPrice) {
price = newPrice;
}

void Product::setQuantity(int newQuantity) {
quantity = newQuantity;
}

void Product::read() {
cout << "Enter the name of the product: ";
cin >> ws;
getline(cin, name);
cout << "Enter the price for a " << name << ": ";
cin >> price;
cout << "Enter the quantity of the " << name << ": ";
cin >> quantity;
}


double Product::getValue() const {
return price * quantity;
}

void Product::print() const {
cout << name << setw(17 - name.length()) << price << setw(8) << quantity << setw(13) << getValue() << endl;
}

// Add a new product to the store
void addProduct(vector<Product>& store);

// List the products in the store
void listProducts(vector<Product>& store);

// Delete a product in the store
void deleteProducts(vector<Product>& store);

// Sell a product in the store
void sellProducts(vector<Product>& store);

// Restock a product in the store
void restockProducts(vector<Product>& store);


// For testing

int main() {
const int SIZE = 3;
vector<Product> store(SIZE);
store[0] = Product("Surboard", 560.00, 100);
store[1] = Product("Leash", 20.00, 150);
store[2] = Product("Wax", 4.00, 200);

int choice = 1;
while (choice != 0) {
cout << "\n0. Exit program\n"
<< "1. Report inventory\n"
<< "2. Add a new product\n"
<< "3. Delete a product\n"
<< "4. Sell a product\n"
<< "5. Restock a product\n"
<< "Choice (0-5): ";
cin >> choice;
cin.ignore(1000, '\n');
if (choice == 1) {
listProducts(store);
} else if (choice == 2) {
addProduct(store);
} else if (choice == 3) {
deleteProducts(store);
} else if (choice == 4) {
sellProducts(store);
} else if (choice == 5) {
restockProducts(store);
} else if (choice != 0) {
cout << "\nInvalid choice!\n";
}
}
cout << "\nGoodbye!\n";

return 0;
}

void addProduct(vector<Product>& store) {
cout << "\nAdding a new product:\n";
Product prod;
prod.read();
store.push_back(prod);
}

void listProducts(vector<Product>& store) {
cout << "\nListing products:\n"
<< "# Name: Price: Quantity: Value:\n";
for (unsigned num = 0; num < store.size(); num++) {
cout << (num + 1) << " ";
store[num].print(); // call print() in Product
}
}

void deleteProducts(vector<Product>& store) {
cout << "\nDeleting a product:\n"
<< "# Name: Price: Quantity: Value:\n";
Product prod;
for (unsigned num = 0; num < store.size(); num++) {
cout << (num + 1) << " ";
store[num].print(); // call print() in Product
}
cout << "Enter the number you wish to delete: ";
int pos;
cin >> pos;
for (unsigned i = pos; i < store.size() - 1; i++) {
store[i] = store[i + 1];
}
store.pop_back();
}

void sellProducts(vector<Product>& store){
cout << "\nSelling a product:\n"
<< "# Name: Price: Quantity: Value:\n";
Product prod;
for (unsigned num = 0; num < store.size(); num++) {
cout << (num + 1) << " ";
store[num].print(); // call print() in Product
}
cout << "Enter the product number that you want to sell: ";
int position;
cin >> position;
Product temp = store[position];
cout << "Enter how many of the product you sold: ";
int num1;
cin >> num1;
prod.getQuantity() = num1 - prod.setQuantity(int newQuantity);
store[position] = temp;
}

void restockProducts(vector<Product>& store){
cout << "\nRestocking a product:\n"
<< "# Name: Price: Quantity: Value:\n";
Product prod;
for (unsigned num = 0; num < store.size(); num++) {
cout << (num + 1) << " ";
store[num].print(); // call print() in Product
}
cout << "Enter the product number that you want to restock: ";
int position;
cin >> position;
Product temp = store[position];
cout << "Enter how many of the product you want to add: ";
int num1;
cin >> num1;
prod.getQuantity() = num1 + prod.setQuantity(int newQuantity);
store[position] = temp;
}
*this is line 207*


please help me find the answer. thanks
prod.getQuantity() = num1 - prod.setQuantity(int newQuantity); prod.getQuantity() = num1 + prod.setQuantity(int newQuantity);

These lines don't make sense. You are trying to assign an integer to the function prod.getQuantity()
Please do use code tags, it's difficult reading in your format.
Be specific for a newbie, Nexius
What is [code] format tag? It's "<>"
Your source is very long so put your code into <> format tag is very necessary if you absolutely want to get some helpful advices and suggestions from others.
Topic archived. No new replies allowed.