0% found this document useful (0 votes)
6 views

2033 Java Project

Uploaded by

omkar23cs
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

2033 Java Project

Uploaded by

omkar23cs
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Name : Omkar dhanavade

Roll NO : 2033

THE CAR COMPANY MANAGEMENT SYSTEM

Introduction :
The Car Company Management System is a robust Java application
meticulously crafted to streamline the intricate processes involved in
overseeing a car company's operations. It serves as a centralized platform for
managing inventory, sales transactions, and comprehensive statistical
analysis, offering a holistic solution to meet the dynamic demands of the
automotive industry.In today's competitive market, efficient management of
inventory is paramount for the success of any car company. The Car
Company Management System empowers users with the capability to
seamlessly add new cars to the inventory, update stock levels in real-time, and
ensure accurate tracking of available vehicles. By providing a user-friendly
interface, the system simplifies the otherwise complex task of managing a
diverse range of car models, allowing for efficient allocation of resources and
optimal utilization of inventory space.Moreover, the system facilitates the
sales process by offering functionalities for selling cars with automated profit
calculations. Through intuitive features, users can initiate sales transactions,
specifying the desired model and quantity, while the system automatically
computes the profit generated from each sale. This not only streamlines the
sales process but also enables users to make informed decisions regarding
pricing strategies and sales targets.In addition to facilitating day-to-day
operations, the Car Company Management System offers valuable insights
into the company's performance through comprehensive statistical analysis.
By aggregating data on inventory levels, sales transactions, and financial
metrics, the system provides users with actionable insights into key
performance indicators such as total stock levels and cumulative profit.
Furthermore, the system enhances decision-making capabilities by presenting
statistical information in a clear and concise manner, enabling stakeholders to
identify trends, evaluate performance, and strategize for future growth. In
essence, the Car Company Management System represents a culmination of
advanced technology and industry expertise, designed to empower car
companies with the tools they need to thrive in today's competitive market
landscape. By offering a comprehensive suite of features for inventory
Name : Omkar dhanavade
Roll NO : 2033

management, sales optimization, and statistical analysis, the system enables


car companies to streamline their operations, maximize efficiency, and drive
sustainable growth in an ever-evolving industry.
Code :

import java.text.NumberFormat;

import java.util.Currency;

import java.util.Locale;

import java.util.Scanner;

// Interface

interface Sellable {

void sell(int quantity) throws OutOfStockException;

// Custom exception for handling out-of-stock situations

class OutOfStockException extends Exception {

public OutOfStockException(String message) {

super(message);
Name : Omkar dhanavade
Roll NO : 2033

// Abstract class representing a vehicle

abstract class Vehicle implements Sellable {

private String model;

private int stock;

private double price;

public Vehicle(String model, int stock, double price) {

this.model = model;

this.stock = stock;

this.price = price;

public String getModel() {


Name : Omkar dhanavade
Roll NO : 2033

return model;

public int getStock() {

return stock;

public double getPrice() {

return price;

@Override

public void sell(int quantity) throws OutOfStockException {

if (stock >= quantity) {

double originalPrice = price * quantity;

double profit = 0.10 * originalPrice;


Name : Omkar dhanavade
Roll NO : 2033

stock -= quantity;

System.out.println("Car(s) sold successfully with a profit of " +


profit);

} else {

throw new OutOfStockException("Sorry, the car is out of stock.");

// Abstract method to be implemented by subclasses

public abstract void start();

// Abstract method to be implemented by subclasses

public abstract void stop();

// Concrete class representing an electric car

class ElectricCar extends Vehicle {


Name : Omkar dhanavade
Roll NO : 2033

private int batteryCapacity;

public ElectricCar(String model, int stock, double price, int


batteryCapacity) {

super(model, stock, price);

this.batteryCapacity = batteryCapacity;

@Override

public void start() {

System.out.println("Electric car started");

@Override

public void stop() {

System.out.println("Electric car stopped");

}
Name : Omkar dhanavade
Roll NO : 2033

// Concrete class representing an internal combustion car

class InternalCombustionCar extends Vehicle {

private int fuelCapacity;

public InternalCombustionCar(String model, int stock, double price, int


fuelCapacity) {

super(model, stock, price);

this.fuelCapacity = fuelCapacity;

@Override

public void start() {

System.out.println("Internal combustion car started");

}
Name : Omkar dhanavade
Roll NO : 2033

@Override

public void stop() {

System.out.println("Internal combustion car stopped");

public class CarCompanyManagementSystem {

// ... (unchanged code)

public static void main(String[] args) {

Scanner scanner = new Scanner(System.in);

// ... (unchanged code)

// Create instances of ElectricCar and InternalCombustionCar

ElectricCar electricCar = new ElectricCar("Tesla", 10, 75000.0, 75);

InternalCombustionCar combustionCar = new


InternalCombustionCar("Toyota", 15, 50000.0, 50);
Name : Omkar dhanavade
Roll NO : 2033

// Add cars to the system

addCar(electricCar);

addCar(combustionCar);

// ... (unchanged code)

public static void addCar(Vehicle vehicle) {

// Use encapsulation to add a car to the system

if (totalCars < MAX_CARS) {

carModels[totalCars] = vehicle.getModel();

carStocks[totalCars] = vehicle.getStock();

carPrices[totalCars] = vehicle.getPrice();

totalCars++;

System.out.println("Car added successfully!");


Name : Omkar dhanavade
Roll NO : 2033

} else {

System.out.println("Cannot add more cars. Maximum limit


reached.");

// ... (unchanged code)

}OUTPUT :

Car Model , Initial Stock, Price


Name : Omkar dhanavade
Roll NO : 2033

Update A Car Model Stock :

Sell Of cars And Profit

Available cars Stock And Price

Statistics (Total cars in Stock And total Profit )

Exiting The Car Showroom Mangement Thank You …!

SWOT analysis

Strengths:

1. User-Friendly Interface:
- The console-based interface makes it easy for users to interact with the
system, especially for simple operations.

2. Modularity:
Name : Omkar dhanavade
Roll NO : 2033

- The code is organized into functions for specific tasks, promoting a


modular structure and ease of maintenance.

3. Basic Functionality:
- The system covers essential functionalities such as adding cars, updating
stock, selling cars, and displaying statistics.

4. Exception Handling:
- The code incorporates exception handling for certain scenarios, providing
a level of robustness.

Weaknesses:

1.Global Variables:
- The use of global arrays for car models, stocks, and prices may lead to
potential issues with scalability and maintenance.

2. Limited Features:
- The system lacks more advanced features like user authentication,
database integration, and a graphical user interface (GUI).

3. Input Validation:
- The code does not perform comprehensive input validation, which could
lead to unexpected behavior if users enter invalid data.

4. No Persistence:
- The system does not save data between program executions, relying solely
on arrays stored in memory.

Opportunities:

1. Enhancements:
- Opportunities exist for enhancing the system with advanced features, such
as GUI, database integration, and additional statistical analysis.

2. Database Integration:
Name : Omkar dhanavade
Roll NO : 2033

- Incorporating a database to store car information could improve data


persistence and management.

3. User Authentication:
- Implementing user authentication and access control could enhance
security and restrict access to authorized users.

4. Error Logging:
- Introducing error logging mechanisms could aid in debugging and
improving system reliability.

Threats:

1. Security Risks:
- Lack of user authentication and authorization poses a security risk,
especially if the system is deployed in a networked environment.

2. Data Loss:
- The absence of data persistence may lead to data loss if the application is
closed or crashes.

3. Limited Scalability:
- The reliance on arrays and a console interface may limit the scalability of
the system for larger datasets or more complex functionality.

4. Technological Changes:
- Changes in technology or Java versions may require updates to the code
for compatibility and security reasons.

You might also like