I need a help in c++ data structure plz

Discussion in 'C++' started by semooo, Nov 29, 2005.

  1. semooo

    semooo Guest

    hi Im waseem
    I need an immediate help as soon as possible,
    I have three simple question with coding problems in data structure i
    c++
    thess are :
    1)suppose that you are finanicier and purchase 100 shares of stock i
    company X , in each of january , april , and september and sell 10
    shares in each of june and november
    the price per share in these months were
    jan apr jun sep nov
    $10 $30 $20 $50 $30

    determine the total amount in your capital gain or loss , using
    a)FIFO accounting
    b)LIFO accounting
    that is assuming that you keep your stock certificate in
    a)a queue or
    b) a stack.

    the 100 shares you still own at the end of the year
    dont enter the calculation.


    question number 2:

    write the methode to implement queues by the simple but slow techniqu
    of keeping the front of queue always in the first position of a leane
    array.


    question number 3:
    write the method to implement queues where the implementation does no
    keep account of the entries in the queue but instead use the specia
    conditions

    rear=-1
    and
    front=0
    to indicate an empty queue

    thank you for caring

    I hope to get the asnwer as soon as possible
    than

    --
    semoo
    Message posted via http://www.exforsys.com for all your training needs
     
    semooo, Nov 29, 2005
    #1
    1. Advertising

  2. semooo

    Sven Hesse Guest

    semooo <> wrote:
    >
    > hi Im waseem


    Sorry to hear that, I hope it's curable...

    > [...]


    Nice homework, have fun doing them!

    > I hope to get the asnwer as soon as possible


    Depends on how fast you work, I guess...

    ....

    *SCNR*
     
    Sven Hesse, Nov 29, 2005
    #2
    1. Advertising

  3. semooo

    Howard Guest

    "semooo" <> wrote in message
    news:...
    >
    > hi Im waseem
    > I need an immediate help as soon as possible,
    > I have three simple question with coding problems in data structure in
    > c++
    > thess are :


    <homework snipped>

    Please refer to the FAQ, esp. section 5:

    http://www.parashift.com/c -faq-lite/
     
    Howard, Nov 29, 2005
    #3
  4. semooo

    Neil Cerutti Guest

    On 2005-11-29, semooo <> wrote:
    >
    > hi Im waseem


    Hello, waseem.

    > I need an immediate help as soon as possible,
    > I have three simple question with coding problems in data
    > structure in c++ thess are :
    > 1)suppose that you are finanicier and purchase 100 shares of stock in
    > company X , in each of january , april , and september and sell 100
    > shares in each of june and november
    > the price per share in these months were
    > jan apr jun sep nov
    > $10 $30 $20 $50 $30
    >
    > determine the total amount in your capital gain or loss , using
    > a)FIFO accounting
    > b)LIFO accounting
    > that is assuming that you keep your stock certificate in
    > a)a queue or
    > b) a stack.
    >
    > the 100 shares you still own at the end of the year dont enter
    > the calculation.


    Using FIFO accounting (the sort I'll use to report to my
    creditors), I gained $1000 in Jun, and $0 in Nov.

    Using LIFO accounting (the sort I'll use to report to the tax
    assessor), I lost $1000 in Jun, and lost $2000 in Nov.

    Using sensible accounting (the sort I'll keep to myself) I've
    lost $1000 in total assets.

    > question number 2:
    >
    > write the methode to implement queues by the simple but slow
    > technique of keeping the front of queue always in the first
    > position of a leaner array.


    A *what* array?

    > question number 3:
    > write the method to implement queues where the implementation
    > does not keep account of the entries in the queue but instead
    > use the special conditions
    >
    > rear=-1
    > and
    > front=0
    > to indicate an empty queue
    >
    > I hope to get the answer as soon as possible


    I'm awake! I'm awake! The answer is 12!

    Seriously, we don't do other people's homework.

    --
    Neil Cerutti
     
    Neil Cerutti, Nov 29, 2005
    #4
  5. I guess that if you paid someone in advance they could do
    your homework for you. But what is the point? You did not
    learn anything. Learn how to learn on your own. Your life
    will be better as a result. I hope you have a good book to
    guide you. I have several that helped me. Why not you?

    Tom.

    "semooo" <> wrote in message
    news:...
    >
    > hi Im waseem
    > I need an immediate help as soon as possible,
    > I have three simple question with coding problems in data structure in
    > c++
    > thess are :
    > 1)suppose that you are finanicier and purchase 100 shares of stock in
    > company X , in each of january , april , and september and sell 100
    > shares in each of june and november
    > the price per share in these months were
    > jan apr jun sep nov
    > $10 $30 $20 $50 $30
    >
    > determine the total amount in your capital gain or loss , using
    > a)FIFO accounting
    > b)LIFO accounting
    > that is assuming that you keep your stock certificate in
    > a)a queue or
    > b) a stack.
    >
    > the 100 shares you still own at the end of the year
    > dont enter the calculation.
    >
    >
    > question number 2:
    >
    > write the methode to implement queues by the simple but slow technique
    > of keeping the front of queue always in the first position of a leaner
    > array.
    >
    >
    > question number 3:
    > write the method to implement queues where the implementation does not
    > keep account of the entries in the queue but instead use the special
    > conditions
    >
    > rear=-1
    > and
    > front=0
    > to indicate an empty queue
    >
    > thank you for caring
    >
    > I hope to get the asnwer as soon as possible
    > thanx
    >
    >
    > --
    > semooo
    > Message posted via http://www.exforsys.com for all your training needs.
    >
     
    Tom the Canuck, Dec 6, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. brian

    Size of my Struct? PLZ PLZ reply

    brian, Nov 23, 2004, in forum: C Programming
    Replies:
    7
    Views:
    421
    -berlin.de
    Nov 25, 2004
  2. Replies:
    1
    Views:
    387
  3. Replies:
    2
    Views:
    342
    Nick Keighley
    Nov 24, 2006
  4. Replies:
    1
    Views:
    350
  5. nocturnal
    Replies:
    1
    Views:
    534
    nocturnal
    Jul 10, 2009
Loading...

Share This Page