Answer to Question #267939 in C++ for Perkit

Question #267939

Write a c++ program for inventory management system for a small convenient store

1
Expert's answer
2021-11-18T06:54:39-0500
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS