Create a simple Inventory System using classes and the concept of separate compilation. Attached below is a template to

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Create a simple Inventory System using classes and the concept of separate compilation. Attached below is a template to

Post by answerhappygod »

Create a simple Inventory System using classes and the concept
of separate compilation. Attached below is a template to
follow.
Create A Simple Inventory System Using Classes And The Concept Of Separate Compilation Attached Below Is A Template To 1
Create A Simple Inventory System Using Classes And The Concept Of Separate Compilation Attached Below Is A Template To 1 (44.25 KiB) Viewed 43 times
Create A Simple Inventory System Using Classes And The Concept Of Separate Compilation Attached Below Is A Template To 2
Create A Simple Inventory System Using Classes And The Concept Of Separate Compilation Attached Below Is A Template To 2 (65.68 KiB) Viewed 43 times
//**********************************************************
// TEMPLATE FOR THE INVENTORY SYSTEM PROJECT
//**********************************************************
//**********************************************************
// CLASS NAME : Menu
// DETAILS : THIS IS THE FIRST CLASS TO BE CALLED IN THE MAIN
PROGRAM
//**********************************************************
class menu // DECIDE WHICH MEMBER BECOMES PUBLIC OR
PRIVATE
{
void main_menu(void) ;
void edit_menu(void) ;
} ;
//**********************************************************
// CLASS NAME : Product
// DETAILS : THIS CLASS CONTAINS FUNCTIONS/METHODS
// RELATED TO PRODUCT
ITEMS
//**********************************************************
class product // DECIDE WHICH MEMBER BECOMES PUBLIC OR
PRIVATE
{
//minimum required functions
void add_item(void) ; //this function stores the
product record in product.txt
void delete_item(void) ; //this function deletes a
product record
void modify_item(void) ; //this function updates a
product record
void display_item(void) ; //this function displays
the product record
// as a bonus, you may
add a function to sort the records
void purchase(void) ; //this function is for
purchase transactions
// and updates the product record
int find_item(int) ; //this function finds a
product record
/* implement features
Add features that would record every
purchase made
which will be stored in
purchase_record.txt
the file may contain info such
as
TransactionID Item No.
Item Name Cost
Purchased Total
001
023 Electrical Tape
25.00 3
75.00
001
015 1" PVC Pipe
205 2
410.00
002
053 LED Bulb 9W
110.00 2
220.00
You can also add a functon that can
search and display a transaction record
from purchase_record.txt using the
TransactionID
*/
int itemcode ;
char itemname[30] ;
float itemprice ;
//this is lacking, you are expected to add the
necessary variables
} ;
//**********************************************************
// THIS FUNCTION SHOWS THE MAIN MENU AND CALLS OTHER
FUNCTIONS
//**********************************************************
void menu :: main_menu(void)
{
char ch ;
while (1)
{
cout <<"1: PURCHASE PRODUCTS"
;
cout <<"2: LIST OF PRODUCTS"
;
cout <<"3: SEARCH PRODUCT"
;
cout <<"4: EDIT PRODUCTS FILE"
;
cout <<"5: TRANSACTIONS
REPORT" ;
cout <<"6: SEARCH TRANSACTION"
;
cout <<"0: QUIT" ;
cout <<"Enter Your Choice : "
;
//your code
}
}
//**********************************************************
// THIS FUNCTION SHOWS THE EDIT MENU AND CALLS OTHER
FUNCTIONS
//**********************************************************
void menu :: edit_menu(void)
{
char ch ;
while (1)
{
cout <<"1: ADD PRODUCTS" ;
cout <<"2: MODIFY PRODUCTS"
;
cout <<"3: DELETE PRODUCTS"
;
cout <<"0: EXIT" ;
cout <<"Enter Choice : " ;
//your code
}
}
// REMEMBER TO IMPLEMEMNT THIS PROJECT USING SEPARATE
COMPILATION
// YOU ARE FREE TO DECIDE ON HOW TO SEPARATE YOUR CLASSES
INTO
// THEIR CORRESPONDING INTERFACE AND IMPLEMENTATION
FILES
// provide proper comments wherever applicable
1 ******** *********** 2 ///****** // TEMPLATE FOR THE INVENTORY SYSTEM PROJECT //*** 3 4 5 6 : //****** // CLASS NAME : Menu // DETAILS : THIS IS THE FIRST CLASS TO BE CALLED IN THE MAIN PROGRAM //******* 7 8 ******* 9 10 11 12 class menu // DECIDE WHICH MEMBER BECOMES PUBLIC OR PRIVATE { void main_menu(void) ; void edit_menu(void) ; }; 13 14 15

**********: ********** ******* 16 17 //******** 18 // CLASS NAME : Product 19 // DETAILS : THIS CLASS CONTAINS FUNCTIONS/METHODS 20 // RELATED TO PRODUCT ITEMS 21 //* 22 23 class product // DECIDE WHICH MEMBER BECOMES PUBLIC OR PRIVATE 24 { v //minimum required functions 26 void add_item(void) ; //this function stores the product record in product.txt 27 void delete_item(void); //this function deletes a product record 28 void modify_item(void); //this function updates a product record 29 void display_item(void) ; //this function displays the product record 30 // as a bonus, you may add a function to sort the records 31 V void purchase(void) ; //this function is for purchase transactions 32 // and updates the product record 33 int find_item(int) ; //this function finds a product record 25 34 35 V 36 37 /* implement features Add features that would record every purchase made which will be stored in purchase_record.txt the file may contain info such as 38

39 40 Item No. Cost Purchased 41 TransactionID 001 001 023 25.00 3 Item Name Electrical Tape 1" PVC Pipe LED Bulb 9W Total 75.00 410.00 220.00 015 205 m NN 42 43 2 002 053 110.00 2 44 45 You can also add a functon that can search and display a transaction record from purchase_record.txt using the TransactionID 46 47 48 49 50 51 52 53 int itemcode ; char itemname[30] ; float itemprice ; //this is lacking, you are expected to add the necessary variables }; 54 55 56 ***** 57 //** || THIS FUNCTION SHOWS THE MAIN MENU AND CALLS OTHER FUNCTIONS //************ 58 <****** ******* 59 60 void menu :: main_menu(void) { 61

61 62 63 char ch ; while (1) { 64 65 66 67 68 69 cout <<"1: PURCHASE PRODUCTS" cout <<"2: LIST OF PRODUCTS" ; cout <<"3: SEARCH PRODUCT" ; cout <<"4: EDIT PRODUCTS FILE" ; cout <<"5: TRANSACTIONS REPORT" ; cout <<"6: SEARCH TRANSACTION" ; cout <<"O: QUIT" ; cout <<"Enter Your Choice : 70 71 72 73 74 75 //your code 76 } } 77 78 79 80 81 //********************************************************** // THIS FUNCTION SHOWS THE EDIT MENU AND CALLS OTHER FUNCTIONS //********************************************************** 82 83

84 85 86 87 88 void menu :: edit_menu(void) { char ch ; while (1) { cout << "1: ADD PRODUCTS" ; cout <<"2: MODIFY PRODUCTS" ; cout <<"3: DELETE PRODUCTS" cout << "0: EXIT" ; cout <<"Enter Choice : "; 89 90 91 ز 92 93 94 95 //your code 96 } 97 } 98 99 100 // REMEMBER TO IMPLEMEMNT THIS PROJECT USING SEPARATE COMPILATION // YOU ARE FREE TO DECIDE ON HOW TO SEPARATE YOUR CLASSES INTO // THEIR CORRESPONDING INTERFACE AND IMPLEMENTATION FILES Il provide proper comments wherever applicable 101 102
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply