473,385 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.

Nov 29 '05 #1
4 1894
semooo <se***********@no-mx.forums.yourdomain.com.au> 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*
Nov 29 '05 #2

"semooo" <se***********@no-mx.forums.yourdomain.com.au> wrote in message
news:se***********@no-mx.forums.yourdomain.com.au...

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/

Nov 29 '05 #3
On 2005-11-29, semooo <se***********@no-mx.forums.yourdomain.com.au> 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
Nov 29 '05 #4
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" <se***********@no-mx.forums.yourdomain.com.au> wrote in message
news:se***********@no-mx.forums.yourdomain.com.au...

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.

Dec 6 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

39
by: Scotter | last post by:
Okay I think my title line was worded misleadingly. So here goes again. I've got quite 20 identical MDB files running on an IIS5 server. From time to time I need to go into various tables and add...
2
by: Alexandre MELARD | last post by:
Hi, My name is alexandre, I am 4th year student at the Napier university of edinburgh. I am finishing my year and do a presentation of my honours project next wednesday (the 5th of May). I am...
0
by: Dale McGorman | last post by:
The following is some code that I am trying to bring over from VB 6.0, that I have working there. I am trying to get to where I can talk to a USB device. I am stuck on how to correctly pass params...
19
by: ern | last post by:
I need a FIFO queue of size 20, to keep track of a running average. Once the queue is full with 20 values, I want to take the sum/20 = AVERAGE. Then when a new value comes in, I want: (Old Sum...
8
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only...
5
by: Y2J | last post by:
I am working through this book on C++ programming, the author is speaking of using linked lists. He gave and example which I found confusing to say the least. So I rewrote the example in a way that...
1
by: Rick Knospler | last post by:
I am trying to convert a vb6 project to vb.net. The conversion worked for the most part except for the fixed length strings and fixed length string arrays. Bascially the vb6 programmer stored all...
4
by: =?Utf-8?B?UHVjY2E=?= | last post by:
The function that I'm trying to call through DLLImport has a parameter that has a C code's vector's Itrator to a structure. I Have marshalled the structure in C# but how do I do the C type...
8
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using vs2005, .net 2, C# for Windows application. I use DllImport so I can call up a function written in C++ as unmanaged code and compiled as a dll us vs2005. My application is able to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.