Implement a command console for changing settings on a
particular object. The command console should allow you to
enter a string and will return the response (very similar to
a terminal session). The commands are as follows:
SET propertyname=newvalue will change the target
object’s member named “propertyname” to have a value equal
to “newvalue”. If the input value is incompatible (i.e. an
int being set to a string), print out an appropriate error
GET propertyname will print out the current value of
the target object’s member named “propertyname”.
GET * will print out a list of all target object
members and their current values.
The system should be extensible for future commands and
should accept an arbitrary object, such that another
developer could insert another object into the system and
rely on the command console to get and set the properties
Please givee me an example.
Definition of priority queue was given. We have to implement
the priority queue using array of pointers with the
priorities given in the range 1..n.
The array could be accessed using the variable top. The list
corresponding to the array elements contains the items
having the priority as the array index.
Adding an item would require changing the value of top if it
has higher priority than top.
Extracting an item would require deleting the first element
from the corresponding queue.
The following class was given:
void put(int item, int priority); // inserts the item with
the given priority.
int get(int priority); // extract the element with the
int count(); // returns the total elements in the priority
int isEmpty(); // check whether the priority queue is empty
We had to implement all these class functions.
write a function that allocates memory for a single data
type passed as a parameter.the function uses the new
operator and return a pointer to the allocated memory.the
function must catch and handle any exception during allocation