[go: up one dir, main page]

0% found this document useful (0 votes)
26 views4 pages

Car Showroom Management Project

Uploaded by

puspendar110605
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views4 pages

Car Showroom Management Project

Uploaded by

puspendar110605
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Car Showroom Management System

This project demonstrates a simple car showroom management system implemented using Python

and Pandas. It includes features such as viewing inventory, adding cars, updating stock quantities,

recording sales, and generating sales reports.

Python Code

import pandas as pd

# Initialize data

inventory_data = {

'CarID': [1, 2, 3],

'Model': ['Honda City', 'Hyundai Creta', 'Maruti Swift'],

'Price': [1000000, 1200000, 800000],

'Quantity': [10, 5, 15]

sales_data = {

'SaleID': [],

'CarID': [],

'QuantitySold': [],

'TotalPrice': []

# Convert to DataFrame

inventory_df = pd.DataFrame(inventory_data)

sales_df = pd.DataFrame(sales_data)
# Menu

while True:

print("\nCar Showroom Management")

print("1. View Inventory")

print("2. Add a Car")

print("3. Update Quantity")

print("4. Record Sale")

print("5. View Sales Report")

print("6. Exit")

choice = int(input("Enter your choice: "))

if choice == 1:

print("\nInventory:")

print(inventory_df)

elif choice == 2:

car_id = int(input("Enter Car ID: "))

model = input("Enter Car Model: ")

price = int(input("Enter Car Price: "))

quantity = int(input("Enter Quantity: "))

new_car = pd.DataFrame({'CarID': [car_id], 'Model': [model], 'Price': [price],

'Quantity': [quantity]})

inventory_df = pd.concat([inventory_df, new_car], ignore_index=True)

print("Car added successfully!")


elif choice == 3:

car_id = int(input("Enter Car ID to update quantity: "))

new_quantity = int(input("Enter new quantity: "))

inventory_df.loc[inventory_df['CarID'] == car_id, 'Quantity'] = new_quantity

print("Quantity updated successfully!")

elif choice == 4:

sale_id = len(sales_df) + 1

car_id = int(input("Enter Car ID: "))

quantity_sold = int(input("Enter Quantity Sold: "))

car = inventory_df[inventory_df['CarID'] == car_id]

if not car.empty and car.iloc[0]['Quantity'] >= quantity_sold:

total_price = car.iloc[0]['Price'] * quantity_sold

new_sale = pd.DataFrame({'SaleID': [sale_id], 'CarID': [car_id],

'QuantitySold': [quantity_sold], 'TotalPrice': [total_price]})

sales_df = pd.concat([sales_df, new_sale], ignore_index=True)

inventory_df.loc[inventory_df['CarID'] == car_id, 'Quantity'] -=

quantity_sold

print("Sale recorded successfully!")

else:

print("Error: Not enough stock available.")


elif choice == 5:

print("\nSales Report:")

print(sales_df)

elif choice == 6:

print("Exiting... Goodbye!")

break

else:

print("Invalid choice. Please try again.")

You might also like