cs project n
cs project n
CERTIFICATE
The references taken in making this project have been declared at the end
of this report.
This project wouldn’t have been feasible without the proper and rigorous
guidance of my Compter teacher Mr.Sarvanan who guided me throughout
this project in every possible way. An investigatory project involves various
difficult lab experiments which have to be carried out by the student to
obtain the observations and conclude the report on a meaningful note.
These experiments are very critical and in the case of failure, may result in
disastrous consequences. Thereby, I would like to thank both Mr.Saravanan
for guiding me on a step by step basis and ensuring that I completed all my
PROBLEMS with ease.
Rigorous hard work has been put in this project to ensure that it proves to be
the best. I hope that this project will prove to be a breeding ground for the next
generation of students and will guide them in every possible way.
Project
overview
Project overview
Objectives:
Conclusion:
► WHAT IS PYTHON?
Database Design:
import sqlite3
def connect_db():
return sqlite3.connect('medical_shop.db')
def get_all_medicines():
conn = connect_db()
cursor = conn.cursor()
cursor.execute('SELECT * FROM medicines')
medicines = cursor.fetchall()
conn.close()
return medicines
conn.close()
def view_medicines():
medicines = get_all_medicines()
print("Available Medicines:")
for medicine in medicines:
print(f"ID: {medicine[0]}, Name: {medicine[1]}, Quantity: {medicine[2]}, Price:
{medicine[3]}")
def main():
while True:
print("\n1. Add Medicine")
print("2. View Medicines")
print("3. Generate Bill")
print("4. Exit")
if choice == '1':
name = input("Enter medicine name: ")
quantity = int(input("Enter quantity: "))
price = float(input("Enter price: "))
add_medicine(name, quantity, price)
print("Medicine added.")
if __name__ == "__main__":
main()
OUTPUT
1. Add Medicine
2. View Medicines
3. Generate Bill
4. Exit
Enter your choice: 1
Enter medicine name: dolo
Enter quantity: 987
Enter price: 5464
Medicine added.
1. Add Medicine
2. View Medicines
3. Generate Bill
4. Exit
Enter your choice: 2
Available Medicines:
ID: 1, Name: paracetamol, Quantity: 500, Price: 12.0
ID: 2, Name: aspirin, Quantity: 50, Price: 1500.0
ID: 3, Name: dolo650, Quantity: 200, Price: 2000.0
ID: 4, Name: Endrogermina, Quantity: 100, Price: 2900.0
ID: 5, Name: amoxicillin 500mg, Quantity: 6, Price: 180.0
ID: 6, Name: sepiro, Quantity: 120, Price: 1900.0
ID: 7, Name: aspirin, Quantity: 12, Price: 212.0
ID: 8, Name: dermcoool, Quantity: 12, Price: 232.0
ID: 9, Name: dolo, Quantity: 987, Price: 5464.0
1. Add Medicine
2. View Medicines
3. Generate Bill
4. Exit
Enter your choice: 4