FindArena > Find Arena > Money

 
Thread Tools Display Modes
  #1 ()
agobeTaulge : // queue.cpp -- function definitions for the linked list implementation of a queue

template <class DataType>
Queue<DataType>::Queue( )
{
front = back = &header;
}

template <class DataType>
Queue<DataType>::Queue( const Queue<DataType> & apqueue )
{
deepCopy( apqueue );
}

template <class DataType>
Queue<DataType>::~Queue( )
{
makeEmpty( );
}

template <class DataType>
Queue<DataType> & Queue<DataType>::operator =( const Queue<DataType> & rqueue )
{
if ( this == &rqueue )
return *this;
makeEmpty( );
deepCopy( rqueue );
return *this;
}

template <class DataType>
void Queue<DataType>::enqueue( const DataType & element )
{
Node<DataType> *ptr = new Node<DataType>;
ptr->info = element;
back->next = ptr;
back = ptr;
}

// dequeues element and returns it in deqElement
// returns false if called on an empty queue; otherwise returns true
template <class DataType>
bool Queue<DataType>::dequeue( DataType & deqElement )
{
if ( front == back )
return false;

Node<DataType> *ptr = front->next;
deqElement = ptr->info;
front->next = ptr->next;
if ( back == ptr )
back = front;
delete ptr;

return true;
}

// returns element at the front of the queue into frontElement without removing it
// returns false if called on an empty queue; otherwise returns true
template <class DataType>
bool Queue<DataType>::peek( DataType & frontElement )
{
if ( front == back )
return false;
frontElement = front->next->info;
return true;
}

template <class DataType>
bool Queue<DataType>::isEmpty( ) const
{
return front == back;
}

template <class DataType>
void Queue<DataType>::makeEmpty( )
{
DataType temp;
while ( dequeue( temp ) );
}

template <class DataType>
inline void Queue<DataType>::deepCopy( const Queue<DataType> & original )
{
Node<DataType> *copyptr = front = &header;
Node<DataType> *originalptr = original.front;
while ( originalptr != original.back ) {
originalptr = originalptr->next;
copyptr->next = new Node<DataType>;
copyptr = copyptr->next;
copyptr->info = originalptr->info;
}
back = copyptr;
}
-------------------------------------------------------------------header file-----------------------------
// queue.h -- class template for the linked list implementation of a queue
// note: use of the copy constructor, overloaded assignment operator, or enqueue function
// can cause an exception to be thrown when heap memory is exhausted

template <class DataType>
struct Node {
DataType info;
Node<DataType> *next;
};



template <class DataType>
class Queue
{
public:
Queue( );
Queue( const Queue<DataType> & apqueue );
~Queue( );
Queue<DataType> & operator =( const Queue<DataType> & rqueue );
void enqueue( const DataType & element );

// dequeues element and returns it in deqElement
// returns false if called on an empty queue; otherwise returns true
bool dequeue( DataType & deqElement );

// returns element at the front of the queue into frontElement without removing it
// returns false if called on an empty queue; otherwise returns true
bool peek( DataType & frontElement );
bool isEmpty( ) const;// returns true if queue is empty
// otherwise returns false
void makeEmpty( );
private:
Node<DataType> *front;
Node<DataType> *back;
Node<DataType> header;
inline void deepCopy( const Queue<DataType> & original );
};

#include "queue.cpp"
  Reply With Quote
  #2 ()
agobeTaulge : On JQuery I would like to make that the background switches from black to blue every 2000 seconds, how would I do this?

Here is my code:

setInterval( function() {
$('body').css('background', 'black');
}, 2000 );
  Reply With Quote
more..
  #3 ()
biorbslorie : $(function(){
$("body").delay(2000).animate({
backgroundColor : 'black'
});
});

EDIT.

I really hate yahoo for posting programmable stuff. breaking that down ab it more so you can see it all.
  Reply With Quote
  #4 ()
aculsosysat : How do i know how much return i am getting without looking at the balance?
  Reply With Quote
  #5 ()
tritdaddy : If you don't have enough knowledge investing in stocks, consult a stock broker or an agency.
These is a serious business, it doesn't work just like you imagine.
  Reply With Quote
  #6 ()
small50v : Sales revenue$82,500$82,500
Cost of goods sold32,60025,400
Operating expenses (including depreciation)16,90016,900
Depreciation9,2009,200
Cash paid for inventory purchases28,60028,600


Determine net cash provided by operating activities under each approach. Assume that all sales were on a cash basis and that income taxes and operating expenses, other than depreciation, were on a cash basis.

I cannot figure this out. I figured net income, but am stuck here.

The only example my book has is this:

Cash received from customers
FIFO $18,500
LIFO $18,500
AVERAGE $18,500
Cash purchases of goods
FIFO 11,000
LIFO 11,000
AVERAGE 11,000
Cash paid for operating expenses
FIFO 4,400
LIFO 4,400
AVERAGE 4,400
Cash paid for taxes
FIFO 990
LIFO 750
AVERAGE 870

Net cash provided by operating activities
FIFO $?2,110
LIFO $?2,350
AVERAGE $?2,230

I will take any advice you may have! Thank you!
  Reply With Quote
  #7 ()
HeteHailm : On January 10, 2012, Badger Co. purchased 25% of the outstanding stock of Crest Co. for $189,000. Crest paid total dividend to all shareholders of $24,600 on July 15. Crest had a net loss of $37,800 for 2012.

a. Journalize Badger's purchase of the stock, receipt of dividend, and adjusting entry for the equity loss in Crest Co. stock.

What I have so far down is

2012 Jan. 10
DR Investment in Crest Co. Stock $189,000
CR Cash $189,000

2012 July 15
?

2012 December 13
?

b. Compute the balance of Investment in Crest Co. Stock for December 31, 2012.
  Reply With Quote
  #8 ()
cronsonia : 7/15 Dividend Revenue is debited for $6,150 (25% of the total value of Crest's outstanding shares)
The credited account is most likely cash (haven't done this in a while so forgive me if I'm wrong but I'm like 90% sure I'm right).

12/13 In real life I have no idea why you would need to adjust for an equity loss. That makes no sense, but here is what I would guess:
Debit Retained Earnings for the amount paid in Dividends and Credit Cash to offset the amount.

b. umm $189,000? lol!
  Reply With Quote