Question: Need help with C++ programming and creating a map class. There are many functions I will need done but I need help figuring out what

Need help with C++ programming and creating a map class. There are many functions I will need done but I need help figuring out what map declaration of objects I need. These are the four functions ill be dealing with.

gram must have a Catalog class with the indicated functions:

AddCategory: Given a category number and name, add it to the catalog. It will have an empty product list. Return false if the category number already exists in the catalog, true otherwise.

AddProduct: Given a category number, a product number, and a product name, add the product to the catalog. Return false if the category number doesnt exist in the catalog or if the product number already exists within the category, true otherwise.

GetCategoryCount: Return the number of categories in the catalog.

GetProductCount: Given a category number, return the number of products in the category; return -1 if the category doesnt exist.

So how do i declare objects such as Product name, product name etc. I was thinking like - map mymap;? But not sure how I should define the objects in my class.

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!