Please help me to develop a shopping cart in java

I want to develop a simple shopping cart application where a particulart owner can add the items, and the user have to select the item code and the quantity he needs. These are the things i need.
Implement a shopping cart with following features.
1. Create items with required attributes.
2. Define shopping cart parameters
3. define stock values
4. Create an order
5. add to cart
6. Copy cart
7. remove item from cart
8. Check out
9. Print history.
i'm so cunfused. Please help me.

/* This program will add the product code,name,and the price of the items
import java.io.*;
import java.util.*;
public class AddingItems
     public String code,name;
     public static float price;
     LinkedList olist=null;
     public AddingItems(String code,String name,float price)
     this.code=code;
     this.name=name;
     this.price=price;
     public Object getUserInput()
     System.out.println();
     GetInput gi=new GetInput();
     int number=gi.getInteger(" Enter the number of items you want to add to the system : ");
     System.out.println();
     System.out.println();
     olist=new LinkedList(); //declaring the array length according to the user input
          for(int i=0;i<number;i++)
               System.out.println(" **** Enter The Product Details *** ");
               System.out.println();
               GetInput gicode=new GetInput();
               code=gicode.getString("\t Enter the product code : ");
               GetInput giname=new GetInput();
               name=giname.getString("\t Enter the name of the product :");
               GetInput giprice=new GetInput();
               price=giprice.getInteger("\t Enter the product price in Rs. :");
               // creating an object of the AddingItems class
               AddingItems items=new AddingItems(code,name,price);
               // the value input from the user to the system is now assigned to the array created with the length given by the user
               olist.add(items);
          return olist;
          public void display()
          System.out.println();
          System.out.println("\t\t\t*** These are the products in the system **** ");
          System.out.println();
          System.out.println("\t\t\t Product Code \t\t\t Product Name \t\t\t Price in Rs.");
          System.out.println();
          for(int i=0;i<olist.size();i++)
          AddingItems items=(AddingItems)olist.get(i);
          System.out.println("\t\t\t "+items.code+"\t\t\t\t "+items.name+"\t\t\t\t "+items.price);
          System.out.println();
          /*public void addItemsToCart()
          System.out.println();
          GetInput input=new GetInput();
          System.out.println();
          String selection=input.getString("Do you want to continue adding the products to your shopping cart ? [y]es,[N]o : ");
          System.out.println();
          switch(selection.charAt(0))
               case 'y':
               case 'Y':
               System.out.println();
               System.out.println("Enter the products and the quantities you want to add to your shopping cart :");
               System.out.println("........................................................................... ");
               LinkedList myList=null;
               break;
               case 'n':
               case 'N':
               System.out.println();
               String message=" You are about to log off from the system: ";
               System.out.println(message);
               break;
               default:
public static void main(String[] args)
AddingItems items=new AddingItems("code","name",price);
//AddingItems[] additems=(AddingItems)items.getUserInput();
items.getUserInput();
items.display();
     /*GetInput input=new GetInput();
     System.out.println();
     String selection=input.getString("Do you want to continue adding the products to your shopping cart ? [Y]es,[N]o : ");
     System.out.println();
     switch(selection.charAt(0))
          case 'y':
          case 'Y':
          System.out.println();
          System.out.println(" Enter the code of the product and the quantity you want to add to the shopping cart ");
          String code=null;
          int quantity=0;
          double total=0.0;
          LinkedList myList=new LinkedList();
          GetInput itemc=new GetInput();
          String itemcc=itemc.getString();
          //GetInput list=new GetInput();
          Scanner sc=new Scanner(System.in);
          System.out.println(" .............. Enter the code and the quantity you wamt to add to your shopping cart");
          System.out.println();
          System.out.println();
          //while(sc.equals(item.code))
          Scanner c=nextString();
          //GetInput list=new GetInput();
          //AddingItems items=new AddingItems("code");
          //String listcode=list.getString("Enter the item code :");
          if(listcode==olist.contains(true))
          myList.add(listcode);     
          GetInput list2=new GetInput();
          //int listquantity=list2.getInteger("Enter the quantity :");
          //myList.add(listquantity);     
          System.out.println("Do you want to continue ");
          break;
          case 'n':
          case 'N':
          System.out.println();
          String message=" You are about to log off from the system: ";
          System.out.println(message);
          GetInput select=new GetInput();
          System.out.println();
          String need=select.getString("Do you want to proceed ? [o]k ,gnore : ");
          case 'o':
          case 'O':
          System.exit(1);
          break;
     default:
          //GetInput input=new GetInput();
     //code=
this is i did using the linked list to add the items to the shopping cart but now i'm so stuck that i can't search for the product code where the user adds is there in the list which is added by the owner. pls help

Similar Messages

  • Developing a shopping cart in java please help

    Implement a shopping cart with following features.
    1. Create items with required attributes.
    2. Define shopping cart parameters
    3. define stock values
    4. Create an order
    5. add to cart
    6. Copy cart
    7. remove item from cart
    8. Check out
    9. Print history.

    dhaval_shah wrote:
    What do you need help with?he's ordering you to do it for him. Not even a "please" to make it sound like a request.
    Of course we're not anyone's homework service (though a lot of kids seem to be under the impression that we are) so the kid can expected to be flamed and made fun of (which will likely lead to him getting agressive and abusive, leading to even more fun for us regulars and his eventual bannishment).

  • Advice please on how to add a shopping cart in iweb

    Hi
    I am going to re-vamp my iweb created website and was wondering if anyone could advise me on how to add a shopping cart please, and which one would you suggest...? Paypal...?
    I use GoDaddy to host my site and publish through MobileMe.
    Also, bit of a two part question.... Can I use simpleviewer on my iweb created site... is it compatible...?
    I would like to go with iweb but may consider other options if this is not possible..
    Thanks for any help
    Gerry....

    Sorted...

  • Need help on getting started with shopping cart!!

    hi guys,
    i want to build a fairly simple shopping cart with servlets and jsps.. can you please point me to a starting point.. a tutorial or a general road map for it.. i am pretty okay with servlets and jsps and currently using them for a web-app..
    any help would be greatly appreciated..thanks..

    go to http://www.moreservlets.com, download the free pdf book "Core Servlets and Java Server Pages", there is a example program on section 9.4 talks about shopping cart.
    Hope it helps.

  • Help with Individual Product - Large/Shopping Cart layout

    Okay we have an online store layout that we kind of configured around our product image, which can be seen here: http://www.divineunity1.com/womens/dresses/blackstrapless We are happy with the way that it looks however we would like to reconfigure our shopping cart to match the style of this product page. How do we change the width of the shopping cart?

    It is not just CSS.
    CSS is only the style and presentation of it, you have HTML as well and layout of the product and store and the overall templates that wrap them. I can not see any changes to a pre-existing BC template, unfortunatly just replace with static images..
    There are guides on the guide section
    http://forums.adobe.com/community/business_catalyst/documents
    You got links to 3rd parties on the right there.
    You got your main help - http://helpx.adobe.com/business-catalyst.html
    If you are really struggling you can contact us at prettypollution.com.au or others if they are in your country. But you may need to pay someone to get things done.

  • Develop simple shopping cart using ADDT

    Hi, I'm new here.I just wondering if its possible to develop a very simple shopping cart application using ADDT?Anyone have any ideas?
    I'm thinking to develop a very simple shopping cart with no shipping cost,tax details and all that.Just an image,description of the product and price.All the orders with be send to 1 or many emails.No payment gateway needed.That's it.And of course got basic common shopping cart features like 'Add to cart','Remove item',session, that's all.Any ideas guys?
    Thanks

    Duh, I figured it out.
    <cfset bar = arraydeleteat(SESSION.shoppingcart, i)>
    I am having a problem when looping not sure why. I think
    because I'm deleting an item in the array it tries to loop to that
    index in the array. It will say "The element at position 3 cannot
    be found". I guess I normally wouldn't have to delete multiple
    positions in the array with a normal shopping cart unless they
    selected two different id's. I'll work on a more advanced shopping
    cart and post again.

  • Help with Wish List / Favorites / Shopping (Cart) without the Shopping.

    I need to add a "Wish List" / "Favorites" that can be emailed to a Muse site that has already been created.  It's like a shopping cart without any need to actually check out and buy anything.  Google searches have not produced much help as of yet except for I did find something called simplecart.js that sounded promising because it uses JavaScript and as far as I can tell Muse can use JavaScript.  I am still struggling figuring out how to implement simplecart.js but at least it was a start.  Would anyone here have any alternative suggestions for me or be able to point me in a different or better direction.  I find it funny that is so hard to find something that says click this button to then add this info to this area.  I just need to keep a running list of items that can be emailed.
    I am using Muse because I am not a coder but any help or suggestions would be greatly appreciated.
    Sincerely,
    Ryan.

    It is not just CSS.
    CSS is only the style and presentation of it, you have HTML as well and layout of the product and store and the overall templates that wrap them. I can not see any changes to a pre-existing BC template, unfortunatly just replace with static images..
    There are guides on the guide section
    http://forums.adobe.com/community/business_catalyst/documents
    You got links to 3rd parties on the right there.
    You got your main help - http://helpx.adobe.com/business-catalyst.html
    If you are really struggling you can contact us at prettypollution.com.au or others if they are in your country. But you may need to pay someone to get things done.

  • Please help me. Cant located the Path of java.exe ???

    I have Windows 7 64bit OS. I download all softwares in 64 bit version.I just download Oracle sql developer
    4.0 (4.0.0.13.80) and jdk 7 u45 with netbeans 7.4 and i also download jre 7, all software are successfully installed on my system. but when i open sql developer ,it prompt for path of java.exe but i cant find the path. in "C:\programs files\jdk7\bin\" but there is no .exe files.
    please help me or guide me , what to do???
    I installed all the softwares successfully. but i can't understand where the problems is ?

    The easiest thing to do is download this:
    "Windows 64-bit - zip file includes the JDK 7"
    When you run the EXE, it won't prompt for anything, it will just run.
    In fact, if you have the JDK properly installed on Windows, the exe won't prompt for the location of Java anymore, so it sounds like you may have an install problem with your Netbeans install?

  • Please help??  complete computerphobic!!  with java error message!

    Please help?
    I have installed the newest version of Java this morning and then did a restart. anyway, when i tried to log onto the online game "Runescape" I found it hard to do. I got the error: Java.lang.ArrayIndexOutOfBoundsException: 8
    I have absolutely no idea what this means, but was instructed to allow TCP thingys (whatever they are!) which I did. I have also uninstalled and then reinstalled but nothing seems to work?
    Please help as I have absolutely no idea what the hell I am doing?
    Thanks
    nicky x

    nickynoodles wrote:
    Oh god no!! surely you can tell how limited my computer knowledge is!!!
    ...No, I don't know you.
    I only play on this site. but got hacked twice in three days, I have assumed its a keylogger and have taken steps to further protect my computer - so in all honesty, I have no idea what is now causing this inability to log on?
    ...Not being able to log on? You were talking about some sort of ArrayIndexOutOfBoundsException...
    Anyway, since the problem is not related to Java software development: you need to contact the people from Runescape.
    Best of luck!

  • Please help error regarding GPShell 1.4.2 with Java Card 2.2.1

    Hi masters..
    please help me regarding GPShell + Smart Card Reader (namely Omnikey Cardman 5321)..
    currently i've a smart card reader (Omnikey) and a sample java card that support for Java Card 2.2.1..
    i've installed Smart card reader's driver, and it has already completely function..
    When i try to run this command in GPShell 1.4.2, i get this report :
    C:\GPShell-1.4.2>GPShell helloInstallgemXpressoProR3_2E64.txt
    mode_201
    gemXpressoPro
    enable_trace
    establish_context
    card_connect
    * reader name OMNIKEY CardMan 5x21 0
    card_connect() returns 0x80100069 (The smart card has been removed, so that furt
    her communication is not possible.
    select -AID A000000018434D00
    Command --> 00A4040008A000000018434D00
    Wrapped command --> 00A4040008A000000018434D00
    select_application() returns 0x00000006 (The handle is invalid.
    Yes, i know that in that script (helloInstallgemXpressoProR3_2E64.txt), there's a script for load helloworld.cap into Java card..
    i tried that because i just want to make sure whether my Java Card run well or not..
    Please help me regarding this..
    Thanks in advance..

    Hi safarmer, thanks for your reply :)..
    Sorry before, i still don't understand about your last reply.. :(
    especially for check the crytpogram.. :(
    could you describe what mean of each line of code from that snippet code?..
    Sequence   : 0002
    challenge  : 598dd3961bfd
    cryptogram : 24cccf18c18437bb
    host       : 5a7787ba91497948
    DEBUG [] - Input to session S-ENC derivation: 01820002000000000000000000000000
    DEBUG [] - S-ENC: adc1163ba2a146fbb94af44c8676fb7cadc1163ba2a146fb
    DEBUG [] - Input to session DEK derivation : 01810002000000000000000000000000
    DEBUG [] - S-DEK: fd01086b6db03bdfe0d5cb61d03ed3abfd01086b6db03bdf
    DEBUG [] - Input to session CMAC derivation: 01010002000000000000000000000000
    DEBUG [] - S-MAC: 3e07b0c8fdfd798a573b9b9889d0cb513e07b0c8fdfd798a
    Input to card cryptogram verification: 5a7787ba914979480002598dd3961bfd8000000000000000
    DEBUG [] - Signature : 24cccf18c18437bb
    DEBUG [] - Cryptogram: 24cccf18c18437bb
    Card cryptogram authenticated=======================================================================================
    =======================================================================================
    i've added script "mode_211" to my script, as follow :
    mode_211
    enable_trace
    establish_context
    card_connect -readerNumber 2
    select -AID a0000000030000
    open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4e4f // Open secure channel
    delete -AID a00000006203010c0101
    delete -AID a00000006203010c01
    delete -AID a00000006203010c0101
    install -file HelloWorld.cap -nvDataLimit 500 -instParam 00 -priv 2
    card_disconnect
    release_contextbut when i executed that script in the console, i got this :
    C:\GPShell-1.4.2>GPShell helloInstallChan.txt
    mode_211
    enable_trace
    establish_context
    card_connect -readerNumber 2
    * reader name OMNIKEY CardMan 5x21-CL 0
    select -AID a0000000030000
    Command --> 00A4040007A0000000030000
    Wrapped command --> 00A4040007A0000000030000
    Response <-- 6F108408A000000003000000A5049F6501FF9000
    open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4
    f -enc_key 404142434445464748494a4b4c4d4e4f // Open secure channel
    Command --> 80CA006600
    Wrapped command --> 80CA006600
    Response <-- 664C734A06072A864886FC6B01600C060A2A864886FC6B02020101630906072A864
    886FC6B03640B06092A864886FC6B040215650B06092B8510864864020102660C060A2B060104012
    A026E01029000
    Command --> 80500000083C4E03633407EC1800
    Wrapped command --> 80500000083C4E03633407EC1800
    Response <-- 0000715457173C2B8FC1FF020002598DD3961BFD8B6F2963C070FF949000
    Command --> 8482010010E17B69E2A3DFEA320B0B457657362614
    Wrapped command --> 8482010010E17B69E2A3DFEA320B0B457657362614
    Response <-- 9000
    delete -AID a00000006203010c0101
    Command --> 80E400800C4F0AA00000006203010C010100
    Wrapped command --> 84E40080144F0AA00000006203010C0101D259A163E654B99900
    Response <-- 6A88
    delete_applet() returns 0x80206A88 (6A88: Referenced data not found.)
    delete -AID a00000006203010c01
    Command --> 80E400800B4F09A00000006203010C0100
    Wrapped command --> 84E40080134F09A00000006203010C01094A9BF13AD2CC3E00
    Response <-- 6A88
    delete_applet() returns 0x80206A88 (6A88: Referenced data not found.)
    delete -AID a00000006203010c0101
    Command --> 80E400800C4F0AA00000006203010C010100
    Wrapped command --> 84E40080144F0AA00000006203010C010156679B9711B83FAB00
    Response <-- 6A88
    delete_applet() returns 0x80206A88 (6A88: Referenced data not found.)
    install -file HelloWorld.cap -nvDataLimit 500 -instParam 00 -priv 2
    file name HelloWorld.cap
    Command --> 80E602001F09A00000006203010C0107A0000000030000000AEF08C60201A8C80201
    F40000
    Wrapped command --> 84E602002709A00000006203010C0107A0000000030000000AEF08C60201
    A8C80201F400D35F07F1D11A31E500
    Response <-- 6985
    install_for_load() returns 0x80206985 (6985: Command not allowed - Conditions of use not satisfied.)What it does mean?..
    so, can i reset THE RETRY COUNTER of my Java Card?..
    could you give me an example script that reset the Retry Counter?..
    Thanks in advance..
    Sorry i really confuse.. :(

  • Please help How can i run Os commands thru Java programs

    Hey,
    I want to stop and restart the linux server thru java program.Is it possible to run the os commands thru java program.
    I had it thru Runtime.getRuntime().exec("*.exe");
    it only runs the exe files.How can run files other than exe files like .bat,com ans shell commands..Any body knows please help with the code..or mail to this address
    [email protected]
    thankyou,
    regards,
    j.mouli

    What about "start command.com /C execute.bat", or using the overload that takes a String[] as argument?
    What if you use the the full path of execute.bat?
    What error code do you get?
    And what comes th linux, I'm not sure... you'll need a shell interpreter there too, me thinks. (never had to run anything with runtime.exec on linux). Check the man pages if csh, bash, ksh, or what ever shell you like.

  • Add search help to standard field in shopping cart

    Hi Experts,
    We are on a SRM 5.0 implementation for classic scenario.
    In the item basic details we have a field tracking number. (BE_TRACKING_NO). We have a requirement to add a search help (drop down with fixed values) to this field. Is this possible to do on a standard way? The fixed values we will need to get from the attributes the user has assigned.
    Regards,
    Tom

    it needs to be done from backend
    you can customise the field to appear from the backend in the portal, and then add a code like  a normal field has to build
    a help
    check ptarQ>customising > additional fields

  • Please help me to develop EJB project on BEA Weblogic Platform 8.1.

    Hi fols ! I am Vishal.
    I want to develop EJB project using BEA Weblogic Platform 8.1 with Weblogic Server.I wih to know entire procedure to create ,deploy,test EJb using Java application,web application etc.So send me detail tutorial of it on my email id [email protected]
    Thank you!

    Buy a good book ... that way you will get your development up-to-speed fast.

  • Search help  for Uploading Point in shopping cart

    Hi all,
    My search help for uploading point in SC, which is created in DDIC, is not visiable in SC on html.
    Could someone tell me how to make F4 visiable on html?
    Thank you the most.
    Regards,
    Danijela

    Hi,
    I think there is a single template for F4 help on SRM for all standards Search Helps.
    Danijela,
    Concerning your Search Help problem, first try to launch the SC transaction in SAPGUI, in order to check that the SE works fine.
    If you have a external ITS, you are also able to launch the transaction from ITS in debug mode.
    The problem may come from the Search Help template, and the ITS functions, but I don't have a system here, so....
    Regards.
    Vadim

  • Please Help with JtextArea!! Need advice from Java expert!

    Hi, I need something VERY simple, and it is unbelievable I'm looking for a solution for so long! I really hope some of you java-gurus can help me out. Here's the thing:
    1. Make a Jframe
    2. Add a JTextArea and use a transparent color (e.g. 0.1f,0.1f,0.1f,0.1f)
    3. loop a setText method to display a constantly varying text, e.g. the time in milliseconds
    I simply can't do it in any way if I use transparency. Without transparency it works with no problems.
    I am on Mac, and I have checked out this site:
    http://www.curious-creature.org/2007/04/10/translucent-swing-windows-on-mac-os-x/
    but I can't figure out how the guy who wrote the code made it work on mac (he didn't add the full code and the imports). I already tried to contact him, but no answer...
    so PLEEEEASE take 5 minutes to write a very small example of how to manage a varying text on a transparent window.
    Thanks a lot in advance
    Lele

    -> did you maybe check out the link I posted?
    Yes, I did which is why I asked the question are you trying to create a transparent JFrame so that the desktop image is displayed in the frame? To my knowledge this feature (if it works) is a Mac only feature and does not work on windows. If this is what you are trying to do then I have no idea how to do it and will not respond any more.
    -> the GPS coordinates are displayed on top of the moving map, with no visible background
    I guess I have trouble understanding what this is - "a map with no background"?
    Is the map just not an image (ie. a JLabel with an ImageIcon) placed in a scrollpane? Then as the map moves you change the viewport position so it looks like the map is moving? Then you can simply add a label containing the GPS coordinates on top of the label representing the map.
    -> have you considered using a JLabel in an OverlayLayout?
    Right which is what I was thinking. Something simple like:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class LabelMap extends JFrame
         public LabelMap()
              JLabel map = new JLabel(new ImageIcon("yourMap.jpg"));
              getContentPane().add(new JScrollPane(map));
              JLabel point = new JLabel();
              point.setLocation(50, 50);
              point.setText(point.getLocation().toString());
              Dimension d = point.getPreferredSize();
              point.setSize(d.width, d.height);
              point.setFocusable(true);
              map.add(point);
              KeyListener kl = new KeyAdapter()
                   public void keyPressed(KeyEvent e)
                        JLabel point = (JLabel)e.getSource();
                        Point p = point.getLocation();
                        if (e.getKeyCode() == KeyEvent.VK_UP)
                             p.y -= 5;
                        else if (e.getKeyCode() == KeyEvent.VK_DOWN)
                             p.y += 5;
                        else if (e.getKeyCode() == KeyEvent.VK_LEFT)
                             p.x -= 5;
                        else if (e.getKeyCode() == KeyEvent.VK_RIGHT)
                             p.x += 5;
                        point.setLocation(p);
                        point.setText(p.getLocation().toString());
                        Dimension d = point.getPreferredSize();
                        point.setSize(d.width, d.height);
              point.addKeyListener(kl);
         public static void main(String[] args)
              LabelMap frame = new LabelMap();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.setSize(300, 300);
              frame.setLocationRelativeTo( null );
              frame.setVisible(true);
    }In the above example you can scroll the image and dynamically move the text using the arrow keys.

Maybe you are looking for

  • Can only open some JPEG files in Camera Raw through Bridge CS3

    I'm running Bridge CS3 version 2.0.0.975. I always edit my JPEG files through Camera Raw in Bridge CS3. I only have to Right-Click on the file and select "Open in Camera Raw...". However, I've come into a situation where some jpg files will not open

  • My Macbook won't play movie files from my camera.

    My girlfriend and I just recently bought a Macbook and love it. However, for some reason when we import movies from our camera to our Macbook, we can't get them to play, no matter what media program we use. The camera, which is a Sony CyberShot DSC-W

  • Sending SAP mail to the workcentre

    Hi Guys, Can i send a SAP mail to the workcentre using the standard FM 'SO_OBJECT_SEND'. Please send me any related documentation or code to achieve the functionality using the above given FM. Thanks, KC.

  • I am SD back ground but FI question - Please experts

    Hi What is the difference between Account receivables module and G/L account module in FI. -? both has different documentation help.sap.com As a SD consultant how to understand which one has clinet  implimented -? Please any one of FI comunity guys h

  • Is there anyone who advertises a product that will cause you to NOT buy it?

    for me its not who advertises it but its who makes it I do not buy kraft,nestle,or pepsi products because all three companies partnered with senomyx click the link and read the whole article what makes me hate senomyx is near the bottom