| |
|
|
Buyer Summary:
|
| |
| Username: |
|
| Feedback Score: |
        
1
reviews
|
| Award Reliability: |
5 posted 1 paid |
| |
|
| Location: |
Miami, OK, United States
|
| Member Since: |
November 3, 2007 |
| |
|
|
|
| Invited Users: |
There are no invited users
|
Description
I. The Double-Ended List
The double-ended list, or Dlist, is a templated container. It supports the following operational methods:
* isEmpty: a predicate that returns true if the list is empty, false otherwise
* insertFront/insertBack: insert an object at the front/back of the list, respectively
* removeFront/removeBack: remove an object from the front/back of a non-empty list, respectively; throws an exception if the list is empty.
Note that while this list is templated across the contained type, T, it inserts and removes only pointers-to-T, not instances of T. This ensures that the Dlist implementation knows that it owns inserted objects, is responsible for copying them if the list is copied, and destroying them if the list is destroyed.
The complete interface of the Dlist class is provided in dlist.h. The code is replicated here for your convenience. You may not modify dlist.h in any way.
The definition of "node", the private type for elements of the container list, is given in the private section of class Dlist. This is so that clients of the class cannot use the type.
In addition to the five operational methods, there are the usual four maintenance methods: default constructor, copy constructor, assignment operator, and destructor. Be sure that your copy constructor and assignment operator do *full* deep copies---including making copies of T's owned by the list.
Finally, the class defines three private utility methods in which to place code common to two or more of the maintenance methods.
You are to provide an implementation for each Dlist method in a file called dlist.cpp, to be handed in with this project. We will test your Dlist implementation separately from the other components of this project, so it must work independently of the two applications.
Note that dlist.h includes dlist.cpp; this is because of the way that template types work in the GNU C++ compiler. To instantate a Dlist of pointers-to-int, for example, you would declare the list:
Dlist il;
This instructs the compiler to instantiate a version of Dlist that contains pointers-to-int, and the compiler *at that point* compiles a version of the Dlist template that contains such pointers-to-int.
Note also that we use the "template " syntax rather than the "template " syntax in dlist.h. The two are equivalent, but we believe that typename makes a bit more sense to the reader.
To compile a program that uses Dlists, you need only inclsde "dlist.h". You do not need to name dlist.cpp on the compiler command line, because dlist.h includes it. As an example, consider the following simple test program, called testl.cpp.
II. RPN Calculator
The first of these applications is a simple Reverse-Polish Notation calculator. An RPN calculator is one in which the operators appear *after* their respective operands, rather than in between them. So, instead of computing the following:
(2 + 3) * 5
an RPN calculator would compute this equivalent expression:
2 3 + 5 *
RPN notation is convenient for several reasons. First, no parentheses are necessary---the computation is always unambiguous. Second, such a calculator is easy to implement given a stack. This is particularly useful, because it is possible to use the DList as a stack.
The calculator is invoked with no arguments, and starts out with an empty stack. It takes its input from the standard input stream, and writes its output to the standard output stream. Here are the commands your calculator must respond to:
a number has the form: one or more digits [0--9] optionally followed by a decimal point and one or more digits. For example, 3 4.56 and 0.12 are all numbers, but -2, 1., and abc are not. A number, when entered, is pushed on the stack. Always valid.
+ pop the top two numbers from the stack, add them together, and push the result. Requires a stack with at least two operands.
- pop the top two numbers from the stack, subtract the first popped number from the second, and push the result. Requires a stack with at least two operands.
* pop the top two numbers from the stack, multiply them together, and push the result. Requires a stack with at least two operands.
/ pop the top two numbers from the stack, divide the second popped number by the first, and push the result. Requires a stack with at least two operands.
n negate: pop the top item, multiply it by -1, and push the result on the stack. Requires a stack with at least one operand.
d duplicate: pop the top item and push two copies of it. Requires a stack with at least one operand.
r reverse: pop the top two items, push the first popped item, then the second. Requires a stack with at least two operands.
p print: print the top item to standard output, followed by a newline. Requires a stack with at least one operand. Leaves the stack unchanged.
c clear: pop all items from the stack. Always valid.
a print-all: print all items from the stack in one line, from top-most to bottom-most, each separated by a single space, followed by a newline. Always valid. Leaves the stack unchanged.
q quit: exit the calculator. Always valid.
Each command is separated by whitespace.
You may not assume that user input is always correct. There are three error messages to report.
1) If a user enters something other than one of the commands above, leave the stack unchanged, advance to the next whitespace character, and print the following message:
cout << "Bad input\n";
2) If a user enters a command that requires more operands than are present, leave the stack unchanged, advance to the next whitespace character, and print the following message:
cout << "Not enough operands\n";
3) If a user enters the divide command with a zero on the top of the stack, leave the stack unchanged, advance to the next whitespace character, and print the following message:
cout << "Divide by zero\n";
Note that the phrase "leave the stack unchanged" is not to be taken literally. It is okay to pop the top two operands for division; if the divisor is zero, be sure push them back before reading the next command.
You may assume that the user will not type EOF before quitting. Here is a short example:
[ 23 ] clip p5 -: ./calc 2 3 4 + * p 14 + Not enough operands d + p 28 q
Implement your calculator in a file called calc.cpp, to be handed in when the project is due. It must work correctly with any valid implementation of DList.
III. Call Center Simulation
The second application is a simple discrete-event simulator, modeling the behavior of a single reservation agent at Northwest Airlines. When a customer calls Northwest, they are asked to enter their WorldPerks number. Calls are then answered in priority order: customers who are Platinum Elite---those having flown 75,000 miles or more in the current or previous calendar year---have their calls answered first, followed by Gold (50,000), Silver (25,000), and finally "regular" customers.
(Now you know why you can never reach a reservation agent on the phone!)
A discrete-event simulator is so called because it considers time as a discrete sequence of points, with zero or more events happening at each point in time. In our simulator, time starts at "time 0", and progresses in increments of one. Each increment is referred to as a "tick".
A discrete-event simulator is usually driven by a script of "independent events" plus a set of "causal rules".
In our simulator, the independent events are the set of customers that place calls to the call center. These events are in a file. The first line of the file has a single entry---the number of events (N) contained in the next N lines. Each of those N lines has the following format:
Each field is delimited by one or more whitespace characters. You may assume that the lines are sorted by timestamp-order, from lowest to highest. Timestamps need not be unique.
is an integer, zero or greater, that denotes the tick at which this call comes in.
is a string; the name of the caller. This string has no spaces.
is one of the following four strings: "none" -- no special status "silver" -- silver elite "gold" -- gold elite "platinum" -- platinum elite
is an integer, denoting the number of ticks required to service this call.
You may assume that the input file is semantically and syntactically correct. Your simulator must obtain this input file from the standard input stream cin.
Your simulator will maintain four queues, one for each status level. The simulation proceeds as follows (these are the causal rules):
* At the beginning of a "tick", announce it.
Starting tick #
* Any callers with timestamps equal to that tick number are inserted into their appropriate queues. When a caller is inserted, you should print a message that looks like this:
Call from Brian a silver member
(As it happens, Prof. Noble is a Silver Elite member this year.)
* After any new calls are inserted into the call queues, the (single) agent is allowed to act.
If the agent is not busy, the agent checks each queue, in priority order from Platinum to None. If the agent finds a call, the agent answers the call, printing a message such as:
Answering call from Brian
This will keep the agent busy for ticks.
If the agent was already busy at the beginning of this tick, the agent continues servicing the current client until the appropriate number of ticks have expired.
If the agent is not busy, and there are no current calls, the agent does nothing, and the clock advances. The program terminates only when all listed calls have been placed, answered, and completed.
Here is a sample input file:
--------------------------------------------- 3 0 Andrew gold 2 0 Chris none 1 1 Brian silver 1 ---------------------------------------------
And the output produced by running the simulator on it:
--------------------------------------------- [ 27 ] clip p5 -: ./call < sample Starting tick #0 Call from Andrew a gold member Call from Chris a regular member Answering call from Andrew Starting tick #1 Call from Brian a silver member Starting tick #2 Answering call from Brian Starting tick #3 Answering call from Chris Starting tick #4 ---------------------------------------------
Implement your simulator in a file called call.cpp, to be handed in when the project is due.
IV. General Requirements
You must use the Dlist container to implement both your stack in the calculator and your queue(s) in the call simulator. You may use any type you see fit as the templated type in each application---however, remember that you only insert and remove pointers-to-objects. You must use the at-most-once invariant plus the Existence, Ownership, and Conservation rules when using your Dlist. Therefore, you can only insert dynamic objects.
You may not leak memory in any way. To help you see if you are leaking memory, you may wish to #include and link against altnew.cpp. This file replaces the new and delete operators (plain and array versions) with an allocator that counts the number of bytes allocated.
NOTE: this reports bytes allocated by *anything* in your program OR anything your program *uses*. For example, if you print output to cout, and it is buffered, the library that implements cout will allocate memory via altnew, and those bytes will be recorded in the total. Thus, it is perfectly acceptable for your program to exit with non-zero allocated memory. But if, for example, altnew reports that memory alloacted grows each time you insert an object and then remove it, you probably have a leak.
As a side effect, this allocator will also complain about double-frees, as well as freeing a block that was not allocated by new or has been corrupted since then. These mechanisms are not foolproof, but they will catch many mistakes. To the best of our knowledge, altnew is portable, but we make no guarantees.
Please note that tools like purify or valgrind will be terribly offended by the sleazy tricks played by the alternate allocator. If you mix these tools, one or both will be very confused.
You must fully implement the Dlist ADT. Note that the obvious implementations of the calculator and simulator do not exercise all of a Dlist's functionality.
Your three files---dlist.cpp, calc.cpp, and call.cpp---will be tested independently. Be sure that they can be compiled separately, with no cross-file dependencies.
You may #include , , , and . No other system header files may be included, and you may not make any call to any function in any other library (even if your IDE allows you to call the function without including the appropriate header file).
Input and/or output should only be done where it is specified.
You may not use goto, nor may you use any global variables that are not const.
V. Files
All files for this project live in Stacks and Queues and Lists.zip. The following are provided:
altnew.h: interface for the alternate allocator altnew.cpp: its implementation dlist.h: the Dlist class declaration testl.cpp: a *very* simple list test case sample: the sample simulator input sample.out: the sample simulator output (use diff!)
In the end three files are need Dlist.cpp, Cal.cpp, and Call.cpp. This project needs to be complete by Monday 3:00 pm EST time and for no more than $45.
Reminder
You may not start working in this and any request before
your bid is accepted. Users who violate this policy
may have their accounts permanently suspended.
|
| Shortlisted |
| Decline Bid |
|
|
Dhaka,
BD
location |
US$80
bid amount
|

         
(206
reviews)
feedback |
7 day(s)
delivery time |

|
| |
please check pmb
Bid Time: 11-29-2007 15:10
|
|
|
|
| Shortlisted |
| Decline Bid |
|
|
Tuscaloosa,
US
location |
US$80
bid amount
|

         
(149
reviews)
feedback |
2 day(s)
delivery time |

|
| |
Please check PM.
thanks
Bid Time: 11-29-2007 07:28
|
|
|
|
| Shortlisted |
| Decline Bid |
|
|
Moscow,
RU
location |
US$45
bid amount
|

         
(36
reviews)
feedback |
3 day(s)
delivery time |

|
| |
hello. If we have weekend to work - your project would be done.
Bid Time: 11-30-2007 08:45
|
|
|
|
|
|
Kiev,
UA
location |
US$40
bid amount
|

         
(14
reviews)
feedback |
2 day(s)
delivery time |

|
| |
Consider it well-done.
Bid Time: 11-29-2007 21:05
|
|
|
|
| Shortlisted |
| Decline Bid |
|
|
Herzeliya,
IL
location |
US$70
bid amount
|

         
(3
reviews)
feedback |
1 day(s)
delivery time |

|
| |
Please check PM.
Bid Time: 11-29-2007 09:38
|
|
|
|
| Shortlisted |
| Decline Bid |
|
|
Wroclaw,
PL
location |
US$90
bid amount
|

         
(3
reviews)
feedback |
2 day(s)
delivery time |

|
| |
Hello, I'm sure you will be satisfied with my work. :)
Bid Time: 11-30-2007 08:45
|
|
|
|
| Shortlisted |
| Decline Bid |
|
|
dhaka,
BD
location |
US$50
bid amount
|

(No Feedback
Yet)
feedback |
6 day(s)
delivery time |

|
| |
Please sir,
Let us have this project. We've experience on this type of work.
thanks.
Bid Time: 11-29-2007 13:14
|
|
|
|
| Shortlisted |
| Decline Bid |
|
|
Lahore,
PK
location |
US$80
bid amount
|

(No Feedback
Yet)
feedback |
2 day(s)
delivery time |

|
| |
Hello
Sir, I am the experienced programmer and designer and I am already developing the similar project and understand what you need.
Well I can negotiate on budget and time frame after your response:)
thanks,
RSC003
Bid Time: 11-29-2007 15:49
|
|
|
|
| Shortlisted |
| Decline Bid |
|
|
Chittagong,
BD
location |
US$75
bid amount
|

(No Feedback
Yet)
feedback |
3 day(s)
delivery time |

|
| |
Please see Pm.
Bid Time: 11-30-2007 09:13
|
|
|
|
|
|
|
|
| |
| Get the Free
Step-by-Step Guide on How to Use GetACoder |
The act of
outsourcing jobs has become easy in the past few years
thanks to GetACoder. However, our team aims at making the
whole process even easier. So, it has now come the time to
provide you with a step-by-step guidance on how to use this
service and succeed in the outsourcing world totally for
FREE.
It doesn't matter if you are a more experienced user or a
novice; using GetACoder will become even simpler with the
help of this E-book. There are two major sections: a Buyers
section and a Coders section.
Buyers will learn:
- How to outsource safely
- How to pick the best freelancers
- How to manage time and money
Coders will learn:
- How to get the best jobs
- How to secure their payments
- How to build a long-lasting relationship with buyers
...and MUCH MORE
Clear examples and pictures illustrating key situations,
great tips and real testimonies of some of our best users...
all in this Outsourcing Guide. So don't loose the
outstanding opportunity to download GetACoder FREE E-book.
|

 |
|
GetACoder is a leading Global Services Marketplace doing business in more than 200 countries. Our unique system accelerates your time to market and provides your business with key competitive advantages. When you use GetACoder you are stretching your budget and saving as much as 60% over traditional outsourcing. GetACoder is changing business, now it's no longer about what you own or build but which resources and talent you can access. With GetACoder you reduce expenses, increase efficiencies, aggressively grow your business, and create a sustainable competitive advantage. GetACoder makes outsourcing to any part of the world an easy task! With GetACoder it's simple to outsource any business request, gain access to global talent and manage jobs online. One of the main advantages of GetACoder is the low labor cost. The typically rates are about seven times lower than the ones in the US or Europe. Posting a request at GetACoder allows the right professional or company to find you and to bid for your work. We are building a reputation for exceeding our customers' expectations and for becoming an extremely cost effective way to outsource work. Use GetACoder when you want to save money, increase efficiency or accelerate the development of your request. With GetACoder you focus on growing your business and let others do the tedious work. Post your request on GetACoder for free. Find out why people outsource jobs with us day after day. Thousands of Satisfied Customers - Submit/View Quotes
| - | GetACoder is a milestone for the global outsourcing community. We highly appreciate their efforts. Thanks to GetACoder Team. - | | - | Cool Place to get work. Thanks. - | | - | We view GetACoder as an opportunity to provide a global exposure to our knowledge and experience. - |
|
|
| |
© 2004-2012 GetACoder. All rights reserved. |
|