Write a C++ code that implements a Binary Search Tree of Products based on their price, where each product object has an ID (int), productName(string), category(string) and price(double) and the implement the following functions: 1. Implement the Product class along with its appropriate functions ( setters , getters, and constructor) along with a void display( ) function that displays the details of the product. 2. Implement/modify insert function: void insert (Product c), where every time this function is called, a product is inserted in the tree. 3. Implement/modify a display function in the BinarySearchTree Class: void display (), where it displays all the products in the tree in ascending order based on their price. 4. Implement a sample program that inputs 5 products and displays them, according to the functions that have been implemented/Modified
This is not a homework site. We won't do your homework for you. However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.
We didn't see your attempts to solve this problem yourself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem is "I don't understand a thing", then you should go back to basics and study again. As it is impossible to find derivative of function without knowledge in arithmetic, you cannot do more complex tasks in programming without clear understanding of basics