Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step: 3

blur-text-image

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

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago