Can you please help write a short program(cpp) format for visual c++
to conform with the following question.
*******************************************************************************
The BSE Butchery Store is struggling to cope with the hoards of
customers eager to purchase its tasty pies. BSE management has decided
that customers will register by name (first name only) on arrival.
They will also be asked to say how much they guarantee to spend (this
will be a float in pounds and pence). Customers will be served on the
basis of the amount they guarantee to spend, thus ensuring that
high-spending customers will jump to the front of the queue, whilst
poor lecturers and students may wait all day. You are commissioned to
write the software. BSE specifies that you will use STL classes, and
that a priority queue will be used to store the customer queue. As a
regular customer yourself of BSE you decide to build into the ordering
algorithm a fix so that when your name is entered it always jumps to
the front of the queue. You justify this on the moral grounds that any
company prepared to pander to the rich deserves to be tricked.
For Part 2 write and test a program which at least does the following:
· Defines a data structure (as a simple struct ) to represent a
customer (name and guaranteed spend).
· Allows customers to be entered into a priority queue based on
the above rule (you need to define the ordering function in a similar
way to that given above)
· Displays the waiting queue of customers, showing their name
and guaranteed spending amount.
For Part 3 Incorporate the above into a simple menu-based program to
organise the orderly management of customers. A sample menu could be:
BSE Butchery Store Menu
Add New customer 1
Serve customer 2
Display Queue size 3
Display queue 4
Quit 5
When a new customer arrives, their name is entered together with the
amount they guarantee to spend. They are entered into the queue (at
the appropriate position).
When a customer is served, a simple message is displayed giving the
name of the customer to be served (which is removed from the queue).
If option 2 is chosen when the queue is empty a simple message is
displayed.
The action of options 3 and 4 should be obvious. For option 4, you
will need to write a display function (very similar to the one given
in the notes). Make sure it prints in the right order (first name to
be printed is the front of the queue). You will of course need to
define a (simple) class to represent the data concept customer (name
and minimum spend).
*******************************************************************************
I do need this urgently if you can help...... |