Professional Documents
Culture Documents
JPR GRP - 02
JPR GRP - 02
DEPARTMENT OF INFORMATION
TECHONLOGY
2022-2023
THAKUR POLYTECHNIC
(An ISO 9001:2008 Certified Institute)
Thakur Complex, West to W. E. Highway, Kandivali (E), Mumbai – 400 101
(Accredited by: National Board Of Accreditation)
Seal of
Institute
ACKNOWLEDGEMENT
This acknowledgment transcends the reality of formality when we would
like to express deep gratitude and respect to all those people behind the
screen who guided, inspired and helped me for the completion of our
project work.
PROPOSAL
Data collection.
Coordination with necessary ethics.
Group discussion.
References from books and internet.
Execution.
Prepare report.
Presentation
Project submission
REPORT
1.0 Rationale
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.
Shopping cart software can be generally categorized into three types of
E-commerce software.
Once the micro project title was disclosed, the given topic was divided into
smaller subtopics which then were sent to all the group members. Once the
group members had received their subtopics, the team members researched
their sub topic and sent their respective data to the team group for everyone
to read and understand. This data was then be accumulated in a report and
submitted to Sir Chintamani Chavan for correction.
import java.util.Scanner;
import java.util.Vector;
import java.io.FileWriter;
import java.io.IOException;
import java.io.File;
import java.io.FileNotFoundException;
{
System.out.println("Aughs!!Your Cart Is Empty-----\n\n");
choices();
}
break;
case 4:
if(i>0)
{
update();
}
else
{
System.out.println("Aughs!!Your Cart Is Empty-----\n\n");
choices();
}
break;
case 5:
if(i>0)
{
show();
}
else
{
System.out.println("Aughs!!Your Cart Is Empty-----\n\n");
choices();
}
break;
case 6:
if(i>0)
{
SaveCart();
}
else
{
System.out.println("Aughs!!Your Cart Is Empty-----\n\n");
choices();
}
break;
case 7:
load();
break;
case 8:
clear();
break;
case 9:
if(i>0)
{
cartTotal();
}
else
{
System.out.println("You Bought Nothing-------\n");
}
break;
default:
System.out.println("Oops!! Incorrect Choice!! Try Again");
break;
}
}
}
System.out.println("\nWhat is the position of your item that you want to
remove");
Scanner s2 =new Scanner(System.in);
pos=s2.nextInt();
pos=pos-1;
System.out.println("Removed Item is:"+v1.elementAt(pos));
v1.remove(pos);
v2.remove(pos);
v3.remove(pos);
v4.remove(pos);
i--;
System.out.println("\nREMOVED SUCCESSFULLY!!!\n");
choices();
}
case 2:
System.out.println("Enter the new Price Of This Item:");
icost = s3.nextInt();
v2.set(pos, icost);
System.out.println("\nUPDATED SUCCESFULLY!!!\n");
break;
case 3:
System.out.println("Enter the new Quantity Of This Item:");
quantity = s3.nextInt();
v3.set(pos, quantity);
total = quantity * icost;
v4.set(pos, total);
System.out.println("\nUPDATED SUCCESFULLY!!!\n");
break;
default:
System.out.println("Oops!! Incorrect Choice!! Try Again");
break;
}
choices();
}
{
System.out.println("YOUR CART>>>>>\n");
for(int j = 0;j<i;j++)
{
System.out.println("ITEM: "+v1.elementAt(j));
System.out.println("COST: "+v2.elementAt(j)+" rs");
System.out.println("QUANTITY: "+v3.elementAt(j));
System.out.println("------------------------");
System.out.println("TOTAL: "+v4.elementAt(j)+" rs");
System.out.println("------------------------\n\n\n");
}
choices();
}
public void SaveCart()
{
// Save cart items to a file
try
{
FileWriter writer = new FileWriter("cart_items.txt");
for (int j = 0; j < i; j++)
{
writer.write(v1.elementAt(j) + " , " + v2.elementAt(j) + " , " +
v3.elementAt(j) + " , " + v4.elementAt(j) + "\n");
}
writer.close();
System.out.println("Cart items saved to the file 'cart_items.txt' \n\n");
}
catch (IOException e) {
System.out.println("An error occurred while saving cart items to file.");
e.printStackTrace();
}
choices();
}
// Split the line into separate values based on the comma delimiter
String[] values = line.split(", ");
System.out.println("Item:" + values[0] + "\tPrice:" + values[1] +
"\tQuantity:" + values[2] + "\tTotal:" + values[3]);
System.out.println();
}
sc.close();
}
catch (FileNotFoundException e)
{
System.out.println("An error occurred while reading cart items from file.");
e.printStackTrace();
}
choices();
}
public void clear()
{
v1.clear();
v2.clear();
v3.clear();
v4.clear();
i = 0; // reset the item count to zero
System.out.println("Cart cleared successfully!\n\n");
choices();
}
void cartTotal()
{
float cartt=0;
for(int j = 0;j<i;j++)
{
cartt=(float)v4.elementAt(j)+cartt;
}
System.out.println("||*****************************||");
System.out.println(" You Have Done Shopping Of: "+cartt+" rs ");
System.out.println(" Pay The Total through UPI");
System.out.println(" Visit us Again ^_^");
//System.out.println("||*****************************||");
}
public static void main(String[] args)
{
System.out.println("\n\n||****************************||");
System.out.println("|| ||");
OUTPUT-
9.0 Conclusion:-
1. This project has real time applications this project is used to manage all
the information about online shopping cart.
2. This project is especially useful for people for getting all required things
for their.