Search:

Type: Posts; User: ss1w

Search: Search took 0.11 seconds.

  1. Replies
    25
    Views
    3,192

    Re: Array List implementation(Buying and selling)

    That is really great. May i check with you the maths logic behind the selling for the captial gain ?
  2. Replies
    25
    Views
    3,192

    Re: Array List implementation(Buying and selling)

    I am really sorry to keep bother you like this, this is my first semester for java programming

    I tried googling and i came up with such inner class. i have nested my function within the private...
  3. Replies
    25
    Views
    3,192

    Re: Array List implementation(Buying and selling)

    Haha. Alright that does clear up the confusion. Great, so now i have created a empty transaction class, linked it to my current document and test document. Also i have replaced 2 arraylist with 1...
  4. Replies
    25
    Views
    3,192

    Re: Array List implementation(Buying and selling)

    That would be like my current implementation or i have reach a new level of clueless.
    *
    public void buy(int stocks, int pice) {
    Stocks.add(stock);
    StockPrice.add(price);...
  5. Replies
    25
    Views
    3,192

    Re: Array List implementation(Buying and selling)

    Ok you lost me there on the implementation part. Are you talking about this ?

    Private class Transaction(Int Stocks, Int Price)
    {


    }
  6. Replies
    25
    Views
    3,192

    Re: Array List implementation(Buying and selling)

    No. The selling part is not debatable.
    Oh dear. I left out a small footnote at the bottom. I have to implement it in a queue and not as a stack.

    @post: The oldest q stocks held are each sold...
  7. Replies
    25
    Views
    3,192

    Re: Array List implementation(Buying and selling)

    This is all the instruction that is given.

    Your job is to implement the class skeleton efficiently according to its
    specification in that file.
    You may use the linear data structures in...
  8. Replies
    25
    Views
    3,192

    Re: Array List implementation(Buying and selling)

    We have cover linked list, array list, doubly linked list, stacks and queues. For this assignment we were told that we can use any linear data structure in java.util, thus i choose array list (queue)...
  9. Replies
    25
    Views
    3,192

    Re: Array List implementation(Buying and selling)

    Hi Jps, i have made the necessary correct. Wasn't aware of the code tag function. Yap. i couldnt figure out how could i keep both array list in syn, even on paper it requires a little work.
    I dont...
  10. Replies
    25
    Views
    3,192

    Re: Array List implementation(Buying and selling)

    The code i have so far is the buying implementation.
    Declaration

    *
    public void buy(int NumItems, int price) // as far as i know, my junit test pass this stage
    Stocks.add(NumItems);
    ...
  11. Replies
    25
    Views
    3,192

    Re: Array List implementation(Buying and selling)

    Base on the example i have set i have worked out the following amount. The value purchased and sold off varies.

    I have purchased the following equipment
    300 equipment - $10
    200 equipment - $20...
  12. Replies
    25
    Views
    3,192

    Re: Array List implementation(Buying and selling)

    I could do the maths on paper so I guess it is more of writing the code that perform the maths :(
  13. Replies
    25
    Views
    3,192

    Array List implementation(Buying and selling)

    I have this question on buying and selling of equipment.

    I am implementing the purchasing part with 2 array list. One to store the amount of equipment bought, the other to store the buying price....
Results 1 to 13 of 13