/MarketPlace-Platform-C-Plus-Plus

This will be a repository of a MarketPlace Platfrom written in pure c++ 💪

Primary LanguageC++

Hello, there CODERS !!! I'm Shaun ...


✋Basic Explanation of Program:

This program acts just same like a web version marketplace, that being said there will be two sides of the program, the owner and the shopper.

- 👴Owner will be able to Upload, Delete, Update multiple products and also view an analyzed sales table.

- 👦Shopper will be able to Shop thru the items the owner provides, add the items to a cart and make a payment.

Note:

- The owner part and the shopper part is written in two different cpp file.
- All of the datas are stored in text files.

📷Screenshots of Program working:

What owner will see:

1️⃣ Menu of program

2️⃣ Owner Registration

3️⃣ Owner Registered

4️⃣ Proof of owner has been registered (.txt)

5️⃣ Owner Login

6️⃣ Owner Logged In (Re-directed to main menu)

7️⃣ Updating Owner Account

8️⃣ Proof of owner account has been updated (.txt)

9️⃣ Sales Analyzing (Picture 1, will prompt out the sales for every types of item)

1️⃣0️⃣ Sales Analyzing (Picture 2)

1️⃣1️⃣ Item Navigation 1 (Navigate between items, in this case Magazine, Movies, Books)

1️⃣2️⃣ Item Navigation 2

1️⃣3️⃣ Item Navigation 3

1️⃣4️⃣ Item Adding (In this case, owner decides to add a magazine item)

1️⃣5️⃣ Updating the item details (We'll be updating the item we added just now)

1️⃣6️⃣ Proof of item being updated

1️⃣7️⃣ Deleteing of an item (We'll be deleting the item we updated just now)

1️⃣8️⃣ Proof of item being deleted

1️⃣9️⃣ Displaying every item in the database (Magazine only since we are in the magazine tab)

2️⃣0️⃣ Displaying sales of a specific type of item (Displaying sales for magazine only)


✋Delimter Concepts Explained:

Problem:

Datas are stored in a table style format in a .txt file (example: figure 1.1). It is impossible to extract data by columns without the delimiter concepts used here. I will explain what i meant, refer to (figure 1.2). For this project, i'm using getline method to retrieve every lines from the txt file, since the txt file are formatted to a table looking style, there will be "impurites"...in this case the "|" to seperate every columns. Impurities = "|".

Solution (uses of delimeter):

string delimeter = "|"

- First, getline is used to retrive every lines one by one from the text file.

- Second, for every line, i used the string.find function to find out all of the position of the "|" in the line and store the position in an array.

- Third, now i have all the "|" position for every line. So, to extract data, i used the string.substr function as the functions takes the value of the first parameter of the function as the starting point of the line and takes the value of the second parameter as the length of the space it needs to read.

- Forth, with all the position stored inside an array, extracting a specific column of data seems easy. For example, lets say, you are trying to extract the data from the first column of the line, the data will be in between the first "|" and the second "|" found. So, with that being said, use the .substr function and pass the position of the first "|" as the first parameter and pass (the position of the second "|" minus the position of the first "|" found, that way you find out the exact space of the column) as the second parameter.

- Fifth, save the data found from the .substr function in a string variable.

- DONE !!!