COMPUTER PROGRAMMING 2

Course Description


The course covers advanced topics in computer programming using general-purpose programming language to solve computing problems. The emphasis of this course is to train students to design, implement, test, and debug programs intended to solve computing problems by implementing advanced programming constructs.


Specification, this course will use the Python programming language to introduce students to advanced topics in computer programming. It will include topics in object-oriented programming (OOP), advanced string manipulation using a regular expression (regex), accessing files and databases, data analysis and data visualization, and graphical user interface (GUI).

JOHN LEO D. ECHEVARIA

Bachelors of Science in Computer ScienceĀ 

Specialization Track in Software Engineering I

Growing up in Manila, I was always fascinated by the power of technology and its ability to change the world. Back in high school, I had the opportunity to join a contest and create a website for our school publishing team, and to my surprise, we were able to reach regionals. That was my first introduction to programming and since then, I fell in love with it. So, when it came time to choose a college, I knew that I wanted to pursue a degree in computer science. But I also knew that to truly excel in this field, I needed to immerse myself in a new environment where I could focus on my studies and gain hands-on experience.


That's why I made the decision to move to Quezon Province to attend college. It's been a big transition, but I'm excited to be here and to be taking classes that will help me achieve my goal of becoming a competent computer science graduate. I'm determined to work hard and make the most of this opportunity.


When I'm not studying, I love to spend my time painting and creating mini programming projects. I believe that art and technology go hand in hand, and I find that these hobbies help me stay creative and inspired. They also let me pursue my interest in both fields and make a balance between the technical and creative side of my life. I also believe that nothing is impossible with hard work and determination, and I'm excited to see what the future holds for me.

FacebookInstagramLinkedInGitHub

Course Learning Outcomes and Performance IndicatorsĀ 

SEMIFINALS COURSE OUTCOMES

COURSE OUTCOME PERFORMANCE INDICATOR

EXPECTATIONS

In this period I expected to learn about databases: what are databases, how are they created, and how are they used in programs.

APPLICATION

Applied the stated course outcomes by creating EduMart, an object-oriented-program that make use of database for product inventory, admin information, customer information, and sales information. The program incorporates the basic CRUD (Create, Read, Update, Delete) principles on various datas and tables in the database.

SemiFinals Course Outcome Indicator Output

The EduMart Store program is a Python-based application that allows users to simulate a school supplies store using a MySQL database. The program is equipped with the mysql.connector module, which allows for easy access and manipulation of the database. Users can operate the program as both an admin and a customer. As an admin, users have the ability to add, edit, and view various information related to the store, including products and sales. As a customer, users can browse and purchase products from the store. Overall, the EduMart Store program offers a convenient and comprehensive way to manage and operate a school supplies store.

About the Database:

The "edumartdb" database comprises of four tables and one admin table. The products table contains essential details on products, such as the product ID, name, price, and quantity in stock. The customers table has the customer ID, name, contact number, email, password, and address. The payment_method table stores payment options with a payment ID and payment method field. The sales table keeps track of sales transactions, including the sale ID, date, customer ID, product ID, quantity sold, total amount, and payment method ID. The sales table also includes foreign keys to link to the customer, product, and payment_method tables. The admins table contains the admin ID, last name, first name, and password. Besides, the products, payment_method, and admins tables have initial data inserted into them.

EduMartDB Class:

About the EduMart Class:

OOP (Object-Oriented Programming) is a programming paradigm that emphasizes the use of objects and their interactions to design and write code. It allows for the creation of reusable code that is modular, flexible, and easy to maintain. By using OOP, the code can be organized into classes that group related methods and data.

The EduMart Class contains the following methods:

EduMart Main Program:

About the Main Program:

This program is a command-line interface for an online store management system. It begins by importing the Store class from the EduMart module, and the time and os modules. Then it clears the console screen using the os.system('cls') command.

Next, it sets up the database environment by prompting the user to input their MySQL username and password. If the user chooses not to use the default database settings, a Store object is created using the entered credentials. Otherwise, a Store object is created using the default database settings.

After the database environment is set up, the program enters a loop to allow the user to log in as either an admin or customer. If the user chooses to log in as an admin, the program prompts the user to enter their credentials. If the login is successful, the program enters another loop where the admin can perform various actions such as viewing products, sales, customers, and admins, adding or removing products or admins, updating product details, or restocking products.

If the user chooses to log in as a customer, the program prompts the user to enter whether they are already registered or not. If the customer is already registered, the program prompts them to enter their credentials. If the login is successful, the program enters another loop where the customer can perform actions such as buying products, editing their account details, or logging out.

If the user chooses to exit the program, the program prints "Exiting..." and exits the loop, thus ending the program. If the user inputs an invalid choice, the program displays an error message and prompts the user to try again. The os.system('cls') command is used to clear the console screen between menu options.

The Flow of the Main Program:

The EduMart Program starts with configuring the database environment to ensure that there'll be no problem connecting to the database. The user will be asked if they want to keep the default database settings or would they like to change it. Afterwards, the program will check if the 'edumart' database already exist and if it contains the correct number of tables. In the case that the table doesn't exist, it'll then create the database and insert the tables with its initial values. If the database exists but there is insufficient number of tables, then it'll drop the database and recreate it from scratch. For a freshly created database, it'll ask the user to create an admin account.

After the setup, the user will be welcomed by a text-ui with options to login either as an admin or as a customer. The admin has the abilitiy to: view products, sales, customers, or admins, add, remove, or update product informations, create another admin, and restock. The changes made by the admin will directly reflect into the database, changing the values of each tables, or viewing them according to the command inputted by the user.

The customer has basic functions of buying products, searching for products, and editing their account. When buying products, the user will be shown the products table, and then they'll be prompted to choose an item_id and quantity to purchase, after that they'll get another prompt asking for their preffered payment method and then the last prompt will ask them to confirm their purchase. The purchase will automatically be saved in the sales table and the stock will automatically decrease as they purchase. The search function enables the user to display product based on text-match or based on price range.

Output Program Demonstration

SemiFinals Output Reflection

During the SemiFinals period, I had high expectations for what I would learn during this period. One of the primary areas of focus for the course was databases, and I was eager to gain a deeper understanding of what databases were, how they were created, and how they were used in programming. I knew that this would be a challenging topic, but I was excited to dive in and tackle the project that was assigned to us.

While creating this project, I encountered several challenges. One of the most significant challenges was coming up with the components of the store database. At first, I found it challenging to visualize and plan the database's structure. Additionally, I also struggled with understanding the different functionalities that the store requires. For instance, implementing the buying process, ensuring that customers are buying within stock limits, and updating stocks after a successful purchase. While I thought of implementing a cart system, it proved to be too complicated, given the limited time I had to complete the project.
To overcome these challenges, I spent time researching and studying databases and their applications. I consulted with my instructor and classmates, who provided invaluable insights into how to overcome these challenges. Additionally, I created a thorough plan and visualized the database's structure to help me understand its different components.
Throughout this period, I have learned a lot about databases, their creation, and their use in programs. I learned about the importance of careful planning and visualization when creating a database, as well as how to execute SQL commands using Python SQL libraries like mysql.connector. I also learned about the various CRUD operations and how they are used to interact with databases.

Overall, this period met my expectations, and I have gained a comprehensive understanding of databases, their creation, and usage in programs. I am happy with the outcome of my project, and I feel that I have achieved the goals I set out to accomplish. However, I believe there is still room for improvement in my project, particularly in implementing additional functionalities like an add-to-cart system, refunds, and discounts, and refactoring some methods in order to make the program less verbose.