 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
semooo Guest
|
Posted: Tue Nov 29, 2005 7:06 pm Post subject: I need a help in c++ data structure plz |
|
|
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.
|
|
| Back to top |
|
 |
Sven Hesse Guest
|
Posted: Tue Nov 29, 2005 7:12 pm Post subject: Re: I need a help in c++ data structure plz |
|
|
semooo <semooo.1z9vhk (AT) no-mx (DOT) forums.yourdomain.com.au> wrote:
Sorry to hear that, I hope it's curable...
Nice homework, have fun doing them!
| Quote: | I hope to get the asnwer as soon as possible
|
Depends on how fast you work, I guess...
....
*SCNR*
|
|
| Back to top |
|
 |
Howard Guest
|
Posted: Tue Nov 29, 2005 7:12 pm Post subject: Re: I need a help in c++ data structure plz |
|
|
"semooo" <semooo.1z9vhk (AT) no-mx (DOT) forums.yourdomain.com.au> wrote
| Quote: |
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/
|
|
| Back to top |
|
 |
Neil Cerutti Guest
|
Posted: Tue Nov 29, 2005 7:34 pm Post subject: Re: I need a help in c++ data structure plz |
|
|
On 2005-11-29, semooo <semooo.1z9vhk (AT) no-mx (DOT) forums.yourdomain.com.au> wrote:
Hello, waseem.
| Quote: | 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.
| Quote: | 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?
| Quote: | 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
|
|
| Back to top |
|
 |
Tom the Canuck Guest
|
Posted: Tue Dec 06, 2005 2:10 pm Post subject: Re: I need a help in c++ data structure plz |
|
|
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" <semooo.1z9vhk (AT) no-mx (DOT) forums.yourdomain.com.au> wrote
| Quote: |
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.
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|