Source code for book store management system in c++
Book Shop Management System
Introduction
BookMart is a book shop selling all varieties of books. It needs a console based application to manage its customer and business data.
Registration
Customers need to register before making any purchase. The registration system has the facility for the users to create their own user name and password. They can use the same for further communication with the system.
The user id and password should be stored in a file named “login.txt”.
The application should display the main menu as shown below
1. Login
2. New User Registration
0. Exit
Option 1: Login
If the user enters the option as 1, the user should be prompted to enter user id and password.
If the user has entered a valid user id and password, the message “Login Successful” should be displayed and the below menu options should be displayed.
1. View Books
2. Purchase
3. Back to Main Menu
If the user id and password does not match, then the message “Login Failed” should be displayed and the main menu should be displayed again.
Option 2: New User Registration
If the user enters the option as 2, the user should be prompted to enter a new user id and password. If that user id is not present in the “login.txt” file, the new details should be written to the file and the message “User Successfully Registered” should be printed else the message “Duplicate User ID” should be printed.
Option 0: Exit
If the user enters 0, the application should exit.
View Books
The book details should be maintained in a file named “book_master.txt”. The data should be stored as shown below.
Book ID ISBN Name Price Publisher
Sample Data
678 81-3434-343-3 Oliver Twist 500 PlaymorePublishers
When the user enters the option as 1, all the book details should be displayed on the screen with proper headings. For example, the output should be shown as below.
Book ID ISBN Name Price Publisher
678 81-3434-343-3 Oliver Twist 500 PlaymorePublishers
890 81-2456-343-4 The Tempest 800 Williams'sPublishers
Purchase
Users can purchase after valid registration with the system by providing the book id.
The number of available books is maintained in a file called “stock.txt”. This file will have the book id and quantity on stock. As purchases are made, the total count should be reduced in stock.txt. Stock.txt will have data as shown below.
678 50
890 70
Purchase details should be written to another file named “purchase.txt”. This file will have the details as follows.
Book ID Name User ID User Name Price
For example,
678 Oliver Twist 11 Shubha 500
Back to Main Menu
If the user enters 3, then the main menu should be displayed.
×