Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

What is electric dipole explain with example

Answered: 1 week ago

Question

What is polarization? Describe it with examples.

Answered: 1 week ago