Write a c++ program for inventory management system for a small convenient store
#include <iostream>
using namespace std;
struct Inventory
{
char name[50];
int item;
float price;
int quantity;
} s[10];
int main()
{
cout << "Enter information of items sold: " << endl;
for(int i = 0; i < 10; ++i)
{
s[i].item = i+1;
cout << "For item number" << s[i].item << "," << endl;
cout << "Enter name: ";
cin >> s[i].name;
cout << "Enter price of item: ";
cin >> s[i].price;
cout << "Enter quantity of item: ";
cin >> s[i].quantity;
cout << endl;
}
cout << "Displaying Inventory Information: " << endl;
for(int i = 0; i < 10; ++i)
{
cout << "\nItem number: " << i+1 << endl;
cout << "Name: " << s[i].name << endl;
cout << "Price: " << s[i].price << endl;
cout << "Quantity: " << s[i].price << endl;
}
return 0;
}
Comments
Leave a comment