Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Assignment#1

Object Oriented Programming


Inventory management program

Due date: Mar 28, 2021

Total Marks: 30

Submission: Source code with all use cases implemented

Viva: explain & demonstrate all use cases (announced later)

Objective: In this assignment you will develop a menu-driven console application for inventory
management that demonstrates the

• Use of reading data from files


• Use of arrays of structure
• Storing data from files into arrays of structure
• Searching in an array of structures
• Passing/returning structures to/from functions
• Structure pointers

Introduction
Inventory management software- often utilized by Departmental stores- is a type of software
used for storing information about the items or goods, its sale/purchase, reporting etc. You are required
to develop an Inventory management application for TEST DEPARTMENTAL STORE. The application will
store data in three different files explained in following paragraphs.

Stock Records:

Data about items in stock are stored in a file named stock.DB. Each line in stock.DB file is a record of
product held in the TEST DEPARTMENTAL STORE. Specifically a stock record contains code (that uniquely
identify the item), its name, the type of item, the manufacturer, the price, any discount available to
customer and the quantity of that item held in the store. An example of this file is shown in the following
figure.

Sales Record
Information about all sales transaction are stored in the Sale.DB file. Each sale record
include InvoiceNo (uniquely identify sale transaction), the date-time at which the transaction is made,
the name of customer, the no of items sold and the total amount of bill paid. Following figure shows the
an example Sale.DB file.

Purchase Record
Information about all purchases made by the storeowner are stored in the purchase.DB
file. Each purchase record include InvoiceNo (uniquely identify the purchase transaction), the name of
supplier, name of product purchased, its type, the name of manufacturer of product, the retail price of
product, cost of the product and the units purchased. Following figure shows an example Purchase.DB
file.
Required functionality

You application will be used by the storeowner for sale, purchase transactions and producing
the reports.

 Each stock record is stored in a user defined data type created through structure.
 Sales and purchase records are also stored in variables of user-defined types.
 On start of the application, data from files are loaded into an array of structure.
 A menu similar to Fig. 1 is shown to the user.
 User enter the menu no, the input is validated, and appropriate functions are called.
 Separate functions are used for different operations like loading stock, printing the menus,
searching for stock, doing the sale, purchase, printing reports etc.
 The use cases are depicted in the following images

________________________________________________________________________

== TEST DEPARTMENTAL STORE ==


________________________________________________________________________

MAIN MENU

1 – PRINT STOCK
2 – SEARCH ITEM
3 – SALE
4 – SALE REPORT
5 – PURCHASE
6 – PURCHASE REPORT
7 – EXIT

Date & Time: Day, Month, Date Time Year


________________________________________________________________________
ENTER YOUR CHOICE: : _

________________________________________________________________________

Figure 1: Main Menu

1- Print STOCK: print all in the following format


________________________________________________________________________

== STOCK REPORT==
________________________________________________________________________

Code Name Type Price Discount(%) Qty

1 BlueMarker stationary 50 0 50

2 Pencil stationary 10 0 200

________________________________________________________________________

2 – SEARCH ITEM

________________________________________________________________________

== ITEM SEARCH==
________________________________________________________________________

ENTER PRODUCT NAME OR CODE: : BlueMarker

________________________________________________________________________

1 BlueMarker stationary 50 0 50

3 – SALE

________________________________________________________________________

== SALE TRANSACTION==
________________________________________________________________________

CUSTOMER NAME : : ABDUL


________________________________________________________________________
________________________________________________________________________

== SALE TRANSACTION==
CUSTOMER: ABDUL

InvoiceNo: 1

________________________________________________________________________

ENTER PRODUCT NAME OR CODE: : BlueMarker


ENTER QTY: : 1
(ADD ANOTHER): : Y ?
________________________________________________________________________

SNO Item Units Price Total

1 BlueMarker 1 50 50

Total Bill ……………. 50

________________________________________________________________________

== SALE TRANSACTION==
CUSTOMER: ABDUL

InvoiceNo: 1

________________________________________________________________________

ENTER PRODUCT NAME OR CODE: : Pencil


ENTER QTY: : 10
(ADD ANOTHER) : : N?
________________________________________________________________________

SNO Item Units Price Total

1 BlueMarker 1 50 50

2 Pencil 10 10 100

Total Bill ……………. 150


4 – SALE REPORT

________________________________________________________________________________________

== SALES REPORT==
________________________________________________________________________________________

InvoiceNo Date-time Customer Name No-of-Items Amount

1 3/20/2021 8:38 PM Abdul 2 150


________________________________________________________________________________________
TOTAL SALES ………………………………… 150
________________________________________________________________________________________

5 – PURCHASE

________________________________________________________________________

== PURCHASE==
________________________________________________________________________

SUPPLIER NAME : : ABC SUPPLIER


InvoiceNo: : 1

________________________________________________________________________
________________________________________________________________________

== PURCHASE==
SUPPLIER: ABC SUPPLIER

InvoiceNo: 1

________________________________________________________________________

PRODUCT NAME: : BlueMarker


TYPE: : stationary
MANFACTURER : : DOLLAR
RETAILPRICE: : 30
COST: : 25
DISCOUNT(%): : 0
QTY: : 50

(ADD ANOTHER)?: : N
________________________________________________________________________

6 – PURCHASE REPORT

_______________________________________________________________________________________________________

== PURCHASE REPORT==
_______________________________________________________________________________________________________

InvoiceNo Supplier ProductName Type Manfacturer RetailPrice Cost Discount(%) Qty

1 ABC supplier BlueMarker stationary DOLLAR 30 25 0 50


_______________________________________________________________________________________________________

TOTAL PURCHASE ………………………………… 50


_______________________________________________________________________________________________________

You might also like