Ajeenkya D. Y.
PATIL SCHOOL OF ENGINEERING
Charholi BK, via Lohegaon,
Pune - 412105
Department of Computer Engineering
2025-26 [4th SEM]
Micro Project Report of
Java Programming
On
“SHOPPING CART”
Submitted by:
Roll no. Name of the Enrollment no.
student
6 Telangi Shreyash 24213470284
8 Kendre Aniket 24213470286
9 Solanke Yogeshwari 24213470287
10 Palak Pardeshi 24213470288
11 Shinde Snehal 24213470289
Under the Guidance of
[Link] Borker
Ajeenkya D. Y. Patil School of Engineering, Lohegaon, Pune
Department of Computer Engineering
CERTIFICATE
This is to certify that micro project report entitled
“SHOPPING CART”
This is to certify that project report entitled “Shopping Cart” submitted in the partial
fulfillment of requirement for the award of the Diploma in Computer Engineering by
Maharashtra State Board of Technical Education as student own work carried out by
them under the guidance and supervision at Ajeenkya DY Patil School of Engineering
(Charholi), during the academic year 2025-26.
Submitted by:
Roll no. Name of the student Enrollment no.
6 Telangi Shreyash 24213470284
8 Kendre Aniket 24213470286
9 Solanke Yogeshwari 24213470287
10 Palak Pardeshi 24213470288
11 Shinde Snehal 24213470289
Place: Charholi (Bk) Date: / / 2026
Prof. Priya Borker Prof. Nita Pawar
Guide H.O.D
ACKNOWLEDGEMEMT
It is with profoundly sense of gratitude that we acknowledge from our
guide prof. Priya Borker She has been guide in the true sense of word, a guide
who satisfaction from our word & progress.
We are highly obliged to prof. Nita Pawar Head of Computer
Department for aberrance & good co-operation given to us for bringing this
project to almost standard.
We are grateful to our principal Dr. Nagesh Shelke for proceeding
acknowledgement to us in the connection of this project concluding. We
appreciate the assistance of all staff that helps us in for their sincere & obliging
help to make our project successfully.
Annexure I
PART A – Micro–Project Proposal
“Shopping cart”
1.0) Aim Benefits of the micro-project:
The “Shopping Cart” has been developed with java programming
using jdk app.
This also minimizes paperwork and manual tasks.
Shopping cart helps us in this project for shopping the things in easy
way from any place.
2.0) Course Outcomes
Use jdk software.
Implement exception handling.
Develop programs using Object Oriented methodology in Java.
3.0) Proposed Methodology
Stepwise description:
1. We collected information from various sources available.
2. Thus execution of project was made.
4.0 Action Plan
[Link] Details of activity Planned start Planned end Name of responsible
date date group members
1. Searching for the topic / /2026 / /2026
2. Confirmed the topic we / /2026 / /2026
searched for for the
micro project
4. Collecting information / /2026 / /2026
5. Making proposal / /2026 / /2026
6. Testing and analysis of / /2026 / /2026
test result
7. Preparation of final / /2026 / /2026
project report
8. Final submission of the / /2026 / /2026 All Members
project
Annexure II
PART B – Micro–Project Proposal
“Shopping cart”
1.0 Rationale:-
1. A shopping cart is a piece of software that acts as an online store's catalog and ordering
process.
2. shopping cart is the interface between a company's Web site.
3. Its deeper infrastructure, allowing consumers to select merchandise; review what they
have selected; make necessary modifications or additions; and purchase the
merchandise
4. Shopping carts can be sold as independent pieces of software so companies can
integrate them into their own unique online solutionor they can be offered as a feature
from a service that will create and host a company's e-commerce website.
2.0 Aim of Micro Project:-
1. The “Shopping Cart” has been developed with java programming using jdk app.
2. This also minimizes paperwork and manual tasks.
3. Shopping cart helps us in this project for shopping the things in easy way from any
place.
3.0 Course Outcomes Integrated:-
1. Use jdk software.
2. Implement exception handling.
3. Develop programs using Object Oriented methodology in Java.
4.0 Litraturereview:-
1. These applications typically provide a means of capturing a client's payment
information, but in the case of a credit card they rely on the software module of the
secure gateway provider, in conjunction with the secure payment gateway, in order to
conduct secure credit card transactions online.
2. Some setup must be done in the HTML code of the website, and the shopping cart
software must be installed on the server which hosts the site, or on the secure server
which accepts sensitive ordering information.
3. E-shopping carts are usually implemented using HTTP cookies or query strings. In
most server based implementations however, data related to the shopping cart is kept in
the session object and is accessed and manipulated on the fly, as the user selects
different items from the cart.
4. Later at the process of finalizing the transaction, the information is accessed and an
order is generated against the selected item thus clearing the shopping cart.
5. Although the most simple shopping carts strictly allow for an item to be added to a
basket to start a checkout process (e.g., the free PayPal shopping cart), most shopping
cart software provides additional features that an Internet merchant uses to fully
manage an online store. Data (products, categories, discounts, orders, customers, etc.) is
normally stored in a database and accessed in real time by the software.
6. Shopping cart software can be generally categorized into three types of E- commerce
software.
Open source software:
1. The software is released under an open source licence and is very often free of charge.
2. The merchant has to host the software with a Web hosting service.
3. It allows users to access and modify the source code of the entire online store.
Licensed software:
1. The software is downloaded and then installed on a Webserver.
2. This is most often associated with a one-time fee, the main advantages of this
option are that the merchant owns a license and therefore can host it on any web
server that meets the server requirements.
Hosted service:
1. The software is never downloaded, but rather is provided by a hosted
service provider and is generally paid for on a monthly or annual basis;
also known as the application service provider (ASP) software model.
2. Some of these services also charge a percentage of sales in addition to the
monthly fee. This model often has predefined templates that a user can choose
from to customize their look and feel.
3. Predefined templates limit how much users can modify or customize the
software with the advantage of having the vendor continuously keep the
software up to date for security patches as well as adding new features.
5.0Actual Methodology followed:
stepwise description:
1. Step by step programming in java.
2. choosing topic and action plans.
3. We collected information from various sources available.
4. Thus execution of project was made.
6.0Actual Resources Used:-
[Link] Name of Specifications Qty
resources
1 Operating Windows 11 01
system
2 Visual 2025 01
Studio
3 Microsoft 2019 01
word
7.0 Source Code:
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
public class ShoppingCart extends JFrame implements ActionListener {
JComboBox<String> categoryBox, productBox;
JTextArea cartArea;
JLabel totalLabel;
JButton addButton, removeButton, buyButton;
HashMap<String, Double> productPrices = new HashMap<>();
HashMap<String, Integer> cart = new HashMap<>();
double total = 0;
public ShoppingCart() {
setTitle("Shopping Cart");
setSize(750, 500);
setLayout(new BorderLayout());
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// ===== PRODUCT DATA =====
[Link]("Laptop", 50000.0);
[Link]("Mobile", 20000.0);
[Link]("Headphones", 3000.0);
[Link]("Dress", 1500.0);
[Link]("Jeans", 2000.0);
[Link]("Shoes", 2500.0);
[Link]("Rice", 60.0);
[Link]("Sugar", 45.0);
[Link]("Oil", 120.0);
// ===== TOP PANEL =====
JPanel topPanel = new JPanel();
[Link](new Color(19, 25, 33));
JLabel title = new JLabel("🛒 My Shopping Cart");
[Link]([Link]);
[Link](new Font("Arial", [Link], 24));
[Link](title);
add(topPanel, [Link]);
// ===== CENTER PANEL =====
JPanel centerPanel = new JPanel();
[Link](new FlowLayout([Link], 20, 20));
String[] categories = {"Electronics", "Fashion", "Groceries"};
categoryBox = new JComboBox<>(categories);
[Link](new Dimension(150, 30));
[Link](new JLabel("Department:"));
[Link](categoryBox);
productBox = new JComboBox<>();
[Link](new Dimension(150, 30));
[Link](new JLabel("Product:"));
[Link](productBox);
addButton = new JButton("Add to Cart");
[Link](new Color(255, 153, 0));
[Link]([Link]);
[Link](addButton);
removeButton = new JButton("Remove Item");
[Link]([Link]);
[Link]([Link]);
[Link](removeButton);
buyButton = new JButton("Buy Now");
[Link](new Color(0, 153, 0));
[Link]([Link]);
[Link](buyButton);
add(centerPanel, [Link]);
// ===== CART PANEL =====
JPanel cartPanel = new JPanel(new BorderLayout());
[Link]([Link]("Your Cart"));
cartArea = new JTextArea(15, 30);
[Link](false);
[Link](new Font("Monospaced", [Link], 14));
[Link](new JScrollPane(cartArea), [Link]);
totalLabel = new JLabel("Total: ₹0");
[Link](new Font("Arial", [Link], 18));
[Link](new Color(0, 128, 0));
[Link]([Link]);
[Link](totalLabel, [Link]);
add(cartPanel, [Link]);
// ===== EVENTS =====
[Link](e -> updateProducts());
[Link](this);
[Link](this);
[Link](this);
updateProducts(); // default category load
setVisible(true);
}
private void updateProducts() {
String selectedCategory = (String) [Link]();
if ([Link]("Electronics")) {
[Link](new DefaultComboBoxModel<>(
new String[]{"Laptop", "Mobile", "Headphones"}));
}
else if ([Link]("Fashion")) {
[Link](new DefaultComboBoxModel<>(
new String[]{"Dress", "Jeans", "Shoes"}));
}
else {
[Link](new DefaultComboBoxModel<>(
new String[]{"Rice", "Sugar", "Oil"}));
}
}
public void actionPerformed(ActionEvent e) {
String selectedProduct = (String) [Link]();
if ([Link]() == addButton) {
[Link](selectedProduct, [Link](selectedProduct, 0) + 1);
total += [Link](selectedProduct);
updateCart();
}
else if ([Link]() == removeButton) {
if ([Link](selectedProduct)) {
int qty = [Link](selectedProduct);
if (qty > 1) {
[Link](selectedProduct, qty - 1);
} else {
[Link](selectedProduct);
}
total -= [Link](selectedProduct);
updateCart();
} else {
[Link](this, "Item not in cart!");
}
}
else if ([Link]() == buyButton) {
if ([Link]()) {
[Link](this, "Cart is empty!");
}
else {
StringBuilder bill = new StringBuilder();
[Link]("=========== SHOPPING BILL ===========\n\n");
for (String item : [Link]()) {
int qty = [Link](item);
double price = [Link](item);
[Link](item + " x " + qty +
" = ₹" + (qty * price) + "\n");
}
[Link]("\n--------------------------------------\n");
[Link]("Total Amount: ₹" + total + "\n");
[Link]("--------------------------------------\n\n");
[Link]("🙏 THANK YOU FOR SHOPPING WITH US 🙏\n");
[Link](" Visit Again! 😊\n");
[Link](this, [Link]());
[Link]();
total = 0;
updateCart();
}
}
}
private void updateCart() {
[Link]("");
for (String item : [Link]()) {
int qty = [Link](item);
double price = [Link](item);
[Link](item + " x " + qty +
" = ₹" + (qty * price) + "\n");
}
[Link]("Total: ₹" + total);
}
public static void main(String[] args) {
new ShoppingCart();
}
}
OUTPUT : This is our final output.
8.0 Skill developed/ Learning out of this Micro-Project:-
1. We have learnabout java programming.
2. It manages all the information about total available, adding,
removing the cart.
3. The purpose of the project is to build an application
program to reduce the manual.
9.0 Application of the microproject:-
1. This project has a real time applications this project is used
to manage all the information about shopping cart online
shopping.
2. This project is especially useful for people for getting all
required things for their.
Conclusion:-
The Shopping Cart System is a Java Swing based application that allows
users to select products from different departments, add or remove items
from the cart, and generate a final bill. This project demonstrates the use
of GUI components, event handling, and data structures like HashMap.
It provides practical understanding of how an online shopping system
works.