Created
November 16, 2013 18:25
-
-
Save matheuss/7503546 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void addProduct(Product* products[]) | |
{ | |
int static count = 1; | |
string description, unity; | |
int option = 1, quantity; | |
float sellPrice, purchasePrice; | |
do | |
{ | |
cout << "Entre com o preço de compra do produto:\n"; | |
cin >> purchasePrice; | |
cout << "Entre com o preço de venda do produto:\n"; | |
cin >> sellPrice; | |
cout << "Entre com a unidade do produto:\n"; | |
cin >> unity; | |
cout << "Entre com a quantidade em estoque do produto:\n"; | |
cin >> quantity; | |
cout << "Entre com a descrição do produto:\n"; | |
flush(); | |
getline(cin,description); | |
products[count] = new Product(sellPrice, purchasePrice, unity, quantity, description); | |
cout << "Produto criado com sucesso!\n" << products[count]->toString("r") << endl; | |
count ++; | |
cout << "Digite 1 para adicionar outro produto ou 0 para sair: \n"; | |
cin >> option; | |
} | |
while(option != 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment