Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- struct Product{
- string code[3];
- string category[3];
- string name[3];
- int quantity[3];
- float price[3];
- };
- int main()
- {
- Product hks;
- for(int i = 0;i < 3;i++){
- cout << "\nPlease insert info for Product " << i+1 << endl << "Code :";
- cin >> hks.code[i];
- cout << "Category: ";
- cin >> hks.category[i];
- cout << "Name: ";
- cin >> hks.name[i];
- cout << "Quantity: ";
- cin >> hks.quantity[i];
- cout << "Price: ";
- cin >> hks.price[i];
- }
- for(int i = 0;i < 3;i++){
- cout << "\n----Product: " << i+1 << " Info----\n";
- cout << "Name: " << hks.code[i] <<endl;
- cout << "\nCategory: " << hks.category[i]<<endl;
- cout << "\nName: " << hks.name[i]<<endl;
- cout << "\nQuantity: " << hks.quantity[i]<<endl;
- cout << "\nPrice: " << hks.price[i]<<endl;
- }
- //system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement