Computer Ip
Computer Ip
OBJECTIVE
Applying Programming Knowledge to Real-World Problems
Utilizing Modern Software Tools
Implementing Object-Oriented Programming (OOP) Principles
Developing Effective Procedural Code
Demonstrating Breadth of Knowledge in Computer Science
Conducting Research and Writing Scholarly Reports
PROPOSED SYSTEM
The proposed system is a computerized application developed in C++ to
manage cloth store operations. It provides modules for inventory management,
sales tracking, billing, and reporting.
Planning Phase:
Design Phase:
Create data flow diagrams, module architecture, and UI layouts.
Development Phase:
Actual coding in C++ is done based on the design.
Implementation Phase:
The system is deployed in the store environment.
TESTING METHODS
Software testing methods are traditionally divided into black box testing and
white box testing. These two approaches are used to describe the point of view
that a test engineer takes when designing test cases.
BLACK BOX TESTING:
Testing the functionality of the application without looking into internal code
structure. Example: Testing the billing system output.
* Automated reporting
Disadvantages:
* Initial setup cost
CODING
import json
import os
DATA_FILE = 'store.json'
# Load data
def load_data():
if not os.path.exists(DATA_FILE):
return []
return json.load(f)
# Save Data
def save_data(data):
json.dump(data, f, indent=4)
def display_stock(data):
if not data:
return
print("\nPRODUCT NAME\tQUANTITY\tPRICE")
print("-" * 40)
print(f"{item['name']}\t\t{item['quantity']}\t\t{item['price']}")
def add_product(data):
for i in range(n+1):
save_data(data)
print("Product added.")
# Refill stock
def refill_stock(data):
found = False
if item['name'].lower() == name.lower():
item['quantity'] += qty
found = True
break
if found:
save_data(data)
print("Stock updated.")
else:
# Withdraw stock
def withdraw_product(data):
if item['name'].lower() == name.lower():
item['quantity'] -= qty
save_data(data)
print("Purchase successful.")
else:
print("Insufficient stock.")
return
# Remove product
def remove_product(data):
if len(new_data) != len(data):
save_data(new_data)
print("Product removed.")
else:
# Menus
def dealer_menu():
data = load_data()
while True:
if choice == '1':
add_product(data)
display_stock(data)
refill_stock(data)
remove_product(data)
break
else:
print("Invalid choice.")
def customer_menu():
data = load_data()
while True:
print("3. Exit")
if choice == '1':
withdraw_product(data)
elif choice == '2':
display_stock(data)
break
else:
print("Invalid choice.")
def employee_menu():
data = load_data()
while True:
print("3. Exit")
if choice == '1':
display_stock(data)
refill_stock(data)
break
else:
print("Invalid choice.")
# Main
def main():
while True:
print("1. Dealer")
print("2. Customer")
print("3. Employee")
print("4. Exit")
role = input("Enter your role: "
if role == '1':
if password == 'dealer':
dealer_menu()
else:
print("Wrong password!")
customer_menu()
if password == 'emp':
employee_menu()
else:
print("Wrong password!")
print ("Exiting...")
break
else:
if _name_ == "_main_":
main ()
OUTPUT