I need a help in c++ data structure plz

S

semooo

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
 
N

Neil Cerutti

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.
 
T

Tom the Canuck

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top