Question: Create a priority queue to store the information for coats at a store(You may implement your priority queue as an array, linked listed or heap)

Create a priority queue to store the information for coats at a store(You may implement your priority queue as an array, linked listed or heap) Each coat will have a price and a designer associated with them

You must have the following 1 ) A header file called pq.h which includes a ) a coat struct with price and designer variables b ) a function prototype to add coats to a priority queue c ) a function prototype to access the cheapest coat in the priority queue d ) a function prototype to delete the cheapest coat from the priority queue Note: you may also add any additional functions you would like but they are not necessary 2 ) An implementation file called pq.cpp with the functions definitions for all functions created in list.h 3 ) A client file called client.cpp which does the following a ) Ask the user for the information for a coat until the user tells you to stop b ) Add the coats information to the priority queue c ) Print the information for the 3 cheapest coats

Example Enter coat designer north face Enter a number 40.38 Would you like to keep going(yes/no) yes Enter coat designer helly-henson Enter a number 50.22 Would you like to keep going(yes/no) yes Enter coat designer levis Enter a number 42.36 Would you like to keep going(yes/no) yes Enter coat designer champion Enter a number 61.83 Would you like to keep going(yes/no) yes Enter coat designer columbia Enter a number 33.45 Would you like to keep going(yes/no) no Cheapest coats Designer: columbia Price: 33.45Designer:northfacePrice:33.45Designer:northfacePrice:40.38 Designer: levis Price: $42.36

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!