SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: POS SYSTEM

  1. #1
    SitePoint Member
    Join Date
    Jan 2012
    Location
    Malaysia
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post POS SYSTEM

    Hello please I need urgent assistant to write a multi-user point of sales system in java that allows the cashier to key in all purchased product codes, quantities and then output a receipt.

    Please where do I start from I am new to programming, it is a command line system

    thanks

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,630
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Starting with a complex multi-platform client-server system that handles money is not a good place to start with programming. You probably should buy or rent one.

  3. #3
    SitePoint Member
    Join Date
    Jan 2012
    Location
    Malaysia
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks I have manage to do something the application is running now but how can I used thread to turn it in a muilti-user system?

    here is the code so far

    import java.util.*;
    public class PointOfSales{

    public static void main(String [] args){

    System.out.println("\f");
    Scanner input = new Scanner(System.in);
    System.out.println(" XTREME POS SYSTEM \n");

    do{
    System.out.println("Enter product code [0 - 9] and qauntity [0 - 9] then press 0 to calculate and print receipt");



    while(true){

    System.out.print("\nProduct code = ");
    String code = input.next();

    System.out.print("Quantity = ");
    int qty = input.nextInt();


    if((code == SENTINEL) || (qty == 0)){
    break;
    }

    double pr = getPrice(code);
    String ds = getDesc(code, qty);

    double check = pr * qty;
    total += check;
    output += ds;
    }

    System.out.println("\n");
    System.out.println(output);
    System.out.println("Total is: " + total);
    System.out.println("Do you wish to continue? (yes or no)");
    condition = input.next();

    }while(condition.equals("yes"));
    }


    private static double getPrice(String thecode){

    String code = thecode;

    if(code.equals("0011")){

    price = 176.2;
    }

    else if(code.equals("0012")){

    price = 156.7;
    }

    else if(code.equals("0013")){

    price = 186.2;
    }

    else if(code.equals("0014")){

    price = 256.3;
    }

    else if(code.equals("0015")){

    price = 216.8;
    }

    return price;
    }



    private static String getDesc(String desc, int q){

    String description = desc;
    int quantity = q;

    if(description.equals("0011")){

    descs = "Product Code -: 0011 \nQuantity -: " + quantity + " \nPrice -: $176.2\n\n";
    }

    else if(description.equals("0012")){

    descs = "Product Code -: 0012 \nQuantity -: " + quantity + " \nPrice -: $156.7\n\n";

    }

    else if(description.equals("0013")){

    descs = "Product Code -: 0013 \nQuantity -: " + quantity + " \nPrice -: $186.2\n\n";
    }

    else if(description.equals("0014")){

    descs = "Product Code -: 0014 \nQuantity -: " + quantity + " \nPrice -: $256.3\n\n";
    }

    else if(description.equals("0015")){

    descs = "Product Code -: 0015 \nQuantity -: " + quantity + " \nPrice -: $216.8\n\n";
    }

    return descs;
    }


    static final String SENTINEL = "0";
    static String condition = "no";
    static String descs;
    static String output = "==+++++++++++++++++++++++++++++++++++++++++++++++++++++==\nProduct Detials\n==+++++++++++++++++++++++++++++++++++++++++++++++++++++==\n\n";
    static double total;
    static int cal;
    static double price;

    }

  4. #4
    SitePoint Wizard
    Join Date
    Jul 2006
    Location
    New Zealand
    Posts
    1,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well to point you in the right direction why build somthing from ground up as for that you can simply try and use PHPPOS
    Last edited by Mittineague; Sep 2, 2012 at 10:30. Reason: removing unnecessary link


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •