How Software Gets Done  


(No Login on Secured Page)

Custom Software Buyers
Request new bids
Search Coders
My Account
 
My Buyer 'To Do' List
 
My bid requests
  My escrow account
 
My General Info
Verification
 
Help for Buyers
Articles for Buyers
FAQ for Buyers
Latest News
 

Custom Software Coders

Newest open work
Browse all work
Search all work
My Account
 
My Coder 'To Do' List
 
My bids
 
My General Info
  My credit account
 
Help for Coders
Articles for Coders
FAQ for Coders
Latest News
 

Affiliates

My account
 
My pipeline
 
My credit account
 
Help for Affiliates
Latest News
 
Newest Open Bid Requests.
Fix bug in phys. mem. registry retrieval
By Sting-Ray on May 10
Max Bid: $20


High Impact Professional Website Design
By PCU on May 10
Max Bid: $450


questions, varied topics.
By jc0000 on May 10
Max Bid: $12


UML
By Anil Upadhyay on May 10
Max Bid: Open to fair suggestions


PROLOG HOMEWORK
By Anil Upadhyay on May 10
Max Bid: Open to fair suggestions


LISP HOMEWORK
By Anil Upadhyay on May 10
Max Bid: Open to fair suggestions


Click here to put this ticker on your own site

Open Work Categories.
Database 
(133 open)
   Access 
(60 open)
   MySQL 
(74 open)
   Oracle 
(9 open)
   SQL Server 
(53 open)
   Other DB 
(13 open)
Documentation / Tech Writing 
(36 open)
Data Entry 
(20 open)
Game Development 
(17 open)
Graphics / Art / Music 
(41 open)
   Graphics 
(46 open)
     3d Animation 
(13 open)
   Art (Misc.) 
(17 open)
   Music 
(6 open)
   3d Modeling 
(4 open)
Language Specific 
(98 open)
   ASP 
(68 open)
   C# 
(38 open)
   C++ / C 
(105 open)
   Cocoa / Obj-C 
(1 open)
   Cold Fusion 
(4 open)
   Delphi 
(27 open)
   Java 
(54 open)
   Perl 
(33 open)
   PHP 
(86 open)
   XML/XSL 
(23 open)
   Visual Basic 
(132 open)
   Visual Basic .Net 
(66 open)
   Other 
(46 open)
Misc 
(38 open)
   CAD 
(3 open)
MultiMedia 
(31 open)
Network 
(41 open)
   Network Design 
(7 open)
   Network Implementation 
(12 open)
Platforms 
(63 open)
   Windows 
(148 open)
     MS Exchange 
(3 open)
     MS Office 
(8 open)
     Other 
(8 open)
   Internet Browser 
(38 open)
   Linux 
(50 open)
   UNIX 
(22 open)
   Hand Held/PDA Programming 
(10 open)
Requirements 
(10 open)
Security 
(33 open)
Testing / Quality Assurance 
(16 open)
Web 
(144 open)
   Page Design 
(71 open)
   Flash 
(44 open)
   Web Services 
(68 open)
   Web (Other) 
(76 open)
Training 
(9 open)
   Computer Based 
(11 open)
 
Other
 
Other Sites

Download the free Rent A Coder IE toolbar!
 
Show Bid Request

A Class with an Array: A stack
Bid Request Id: 5212
Bookmark in my 'To Do' list
Posted by: walla (25 ratings)
(Software buyer rating 10)
Non-action Ratio: Very Good - 14.29%
Posted: Nov 20, 2001
3:20:27 PM EDT
Bidding Closes: Nov 21, 2001
11:21:06 PM EDT
Viewed (by coders): 526 times
Phase:
100% of work completed and accepted. Coder has been paid.
Max Accepted Bid: Bidding is closed
Project Type: Personal Project / Homework Help
Bidding Type: Open Auction
Categories: C++ / C
Enter chat room for this bid request
(0 active users at May 10, 2003 8:57:44 PM EDT)

Description:
Implement a LIFO, Last In First Out, data structure, also known as a "stack."

Create a class Stack to implement a stack and use Push() and Pop() as its primary methods adding and removing items from it.

Here is the prototype for the class Stack:

#define SIZE 10

class Stack
{
private:
double data[SIZE];
int top_of_stack; // keeps track of recent pushes public:
void Init(); // or we could use a constructor
void Push(double item_to_push);
double Pop();
};

The client creates an empty stack of doubles with:

Stack stk;

stk.Init();

Then, whenever the client wants to "push" something onto the stack, it calls

stk.Push( some_number );

and when the client wants to remove an item and look at it, it calls:

cout << stk.Pop();

If the client tries to Pop() from a stack with nothing on it, then an error should be generated. If it tries to Push() so that more than SIZE (or whatever the size of data is) items would end up on the stack, it also generates an error.

Design a test main that creates at least two separate stack objects and pushes and pops items from each, printing as necessary.

Deliverables:
Here is an example of an acceptable main():

int main()
{
Stack s1, s2;
int k;

// Initialize stacks ------------
s1.Init();
s2.Init();
// Test the Stack ----- cout << s1.Pop();

s1.Push( 2.34 );
s1.Push( 3.56 );
s1.Push( 7.89 ); // just for fun
s2.Push( -1.003 );
s1.Push( 5000700 );
s1.Push( 123456789.123456789 );

s2.Push( 1 );
s2.Push( 2 );
s1.Push( 3 );
s2.Push( 4 );
s1.Push( 5 );
s2.Push( 6 );

cout << "\n------------ First Stack ------------\n";
for (k=0; k<8; k++)
cout << s1.Pop() << endl;

cout << "\n------------ Second Stack ------------\n";
for (k=0; k<8; k++)
cout << s2.Pop() << endl;

return 0;
}

and associated sample run:

/* ------------------- SAMPLE RUN ---------------
Stack Empty
0
------------ First Stack ------------
5
3
1.23457e+08
5.0007e+06
7.89
3.56
2.34
Stack Empty
0

------------ Second Stack ------------
6
4
2
1
-1.003
Stack Empty
0
Stack Empty
0
Stack Empty
0
---------------------------------------------- */

Use this to test that your class works, but submit a different main and run

Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased.


Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements. We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation. If you notice a violation please help out the site and report it. Thanks for your help.
 
Bidding/Comments:
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests.

See all rejected bids (and all comments)
Name   Bid Amount 
 
Date   Coder Rating  
This bid was accepted by the buyer!
Sammy Leong
(78 ratings)
in Scarborough, Ontario
Canada
Bid id: 55,764
 
$25 (USD) Nov 20, 2001
8:16:31 PM EDT
 10
(Excellent)
   
 




Quick Search
 

 Advanced Search
Newest Open Work
Latest News

 
Credentials


 

 
Rent A Coder upholds the rigorous business practices required to be both a BBB member and Square Trade vendor.
  • All customer issues addressed within 2 days
  • Openly disclosed pricing and return policies
  • Participation in mediation at buyer request
  • Superior selling track record
This site is verified through its parent company, Exhedra Solutions, Inc.
 

Rent A Coder Top Coders.


Anuj Gakhar
Rated a 9.98 on 92 jobs 
Securenext
Rated a 9.98 on 97 jobs 
Buddies
Rated a 9.82 on 76 jobs 
Codman
Rated a 9.97 on 138 jobs 
Andrei Remenchuk
Rated a 10 on 12 jobs 
Michael Sharp
Rated a 9.97 on 170 jobs 
teleCODERS
Rated a 9.93 on 67 jobs 
RNA
Rated a 9.93 on 35 jobs 
hernest
Rated a 10 on 109 jobs 
markesh
Rated a 10 on 21 jobs 

See all top coders...

(What makes a top coder?)

Top Exam Scorers
 
Other
Rent A Coder is PayPal verified through its parent company, Exhedra Solutions, Inc.

Created in partnership with:

 


Affiliate Sites



Latest News | About Us | Kudos | Feedback/Contact    Affiliates | Advertise    Privacy | Legal

Copyright © 2001, Exhedra Solutions, Inc. All rights reserved.
By using this site you agree to its Terms and Conditions.
"Rent A Coder" (tm), "Safe Project Escrow" (tm) and "How Software Gets Done" (tm)
are trademarks of Exhedra Solutions, Inc.