Screenshots
Item Description
Features
This is a C++ program that simulates a departmental store management system. The program uses a 3D array to represent a departmental store with multiple shelves, and each shelf having multiple positions to store items. The program provides a menu-driven interface for the user to perform various operations on the departmental store such as inserting an item, displaying all items, deleting an item, deleting all items, returning the total number of items in a specific shelf, returning the total number of items in the store, finding an item, updating an item, checking if a shelf is empty, and checking if a shelf is full.
The program starts by taking input from the user for the number of shelves and the number of positions on each shelf. It then creates a 3D array of character pointers with the specified dimensions. The program uses dynamic memory allocation to create the 3D array, ensuring that the array can accommodate any number of shelves and positions specified by the user.
The program then displays a menu to the user with various options to perform operations on the departmental store. The user can choose an option by entering the corresponding number. The program uses a do-while loop to continuously display the menu and perform operations until the user chooses to exit the program.
The program provides the following options to the user:
- Press 1 For Inserting An Item: This option allows the user to insert an item into the departmental store. The program takes input for the shelf number and position number where the item is to be inserted. It then allocates memory for the item name and takes input for the item name. The program checks if the shelf and position already contain an item. If yes, then the program displays an error message. Otherwise, it inserts the item into the specified shelf and position.
- Press 2 For Displaying All Items: This option displays all the items present in the departmental store. The program loops through the 3D array and displays the shelf number, position number, and item name for each non-null cell in the array.
- Press 3 For Remove An Item: This option allows the user to remove an item from the departmental store. The program takes input for the shelf number and position number of the item to be removed. It then deallocates the memory allocated for the item name and sets the corresponding cell in the 3D array to null.
- Press 4 ForRemove All The Items: This option removes all the items from the departmental store. The program loops through the 3D array and deallocates the memory allocated for the item name for each non-null cell in the array.
- Press 5 For Return Total No Of Items In Specific Shelf: This option returns the total number of items present in a specific shelf. The program takes input for the shelf number and loops through the corresponding shelf in the 3D array to count the number of non-null cells.
- Press 6 For Return Total No Of Items: This option returns the total number of items present in the departmental store. The program loops through the entire 3D array and counts the number of non-null cells.
- Press 7 For Find An Item: This option allows the user to find an item in the departmental store. The program takes input for the item name and loops through the entire 3D array to find a match. If a match is found, the program displays the shelf number and position number of the item. If no match is found, the program displays an error message.
- Press 8 For Updating An Item: This option allows the user to update an item in the departmental store. The program takes input for the shelf number, position number, and new item name. It then deallocates the memory allocated for the old item name and allocates memory for the new item name.
- Press 9 To Check If Shelf Is Empty: This option checks if a specific shelf in the departmental store is empty. The program takes input for the shelf number and loops through the corresponding shelf in the 3D array to check if all the cells are null. If yes, the program displays a message indicating that the shelf is empty. Otherwise, it displays a message indicating that the shelf is not empty.
- Press 10 To Check If Shelf Is Full: This option checks if a specific shelf in the departmental store is full. The program takes input for the shelf number and loops through the corresponding shelf in the 3D array to count the number of non-null cells. If the number of non-null cells is equal to the number of positions on the shelf, the program displays a message indicating that the shelf is full. Otherwise, it displays a message indicating that the shelf is not full.
- Press 0 To Exit:This option allows the user to exit the program.
The program also provides an option to store the record in a file. The program takes input for the filename and opens a file with the specified name in write mode. It then loops through the entire 3D array and writes the shelf number, position number, and item name for each non-null cell in the array to the file. The program closes the file after all the records have been written.
The program uses dynamic memory allocation to allocate and deallocate memory for the item names. It uses the new and delete operators to allocate and deallocate memory. The program also uses the cin, cout, and ifstream objects to take input from the user and display output on the console.
The program uses a 3D array to represent the departmental store. The first dimension of the array represents the number of shelves, the second dimension represents the number of positions on each shelf, and the third dimension represents the item name. The program uses a null pointer to represent an empty cell in the array.
The program uses user-defined functions to perform various operations on the departmental store. Each function is responsible for a specific operation, such as inserting an item, displaying all items, deleting an item, and so on. The program passes the 3D array and the dimensions of the array as arguments to each function.
The program uses a separate function to store the record in a file. The function takes the 3D array and the dimensions of the array as arguments and writes the records to a file.
The program uses comments to explain the code and make it easier to understand. The comments describe the purpose of each function, the input and output parameters, and the steps involved in the implementation.
In conclusion, this program is a simple simulation of a departmental store management system. It provides a menu-driven interface for the user to perform various operations on the departmental store. The program uses a 3D array to represent the departmental store and dynamic memory allocation to allocate and deallocate memory for the item names. The program uses user-defined functions to perform various operations on the departmental store and stores the records in a file. The program is well-documented with comments, making it easy to understand and modify.
All Reviews
Free support included
Future item updates
100% Satisfaction guarantee
Download code immediately after purchase
Without any isssue on 100% and published by the developer
Quality guarantee for your satisfaction
All Questions
Future item updates
100% Satisfaction guarantee
Download code immediately after purchase
Information
Category | Scripts & Code / C & C++ |
First Release | 18 March 2024 |
Last updated | 18 March 2024 |
File Size | 1 MB |
Frameworks | C & C++ |