All stores in some store chain assign 6-digit positive integer
number
for each product, we will call this number item ID. Last 3 digits of the
item ID is a category ID.
(55 points)Write a function int count_category(int store_size, int
categoryID)
that has 2 parameters: number of items in the store and category ID. The
function reads 6-digit ID for each item, and finds and returns the number
of
items in the store in specific category.
(40 points)Write a function double ave_category(int
stores, int categoryID)
that has 2 parameters: number of stores and category ID. The function
reads number of items in each store, then uses
function count_category to find the number of items in specific category
in each store, then finds and returns the average number of items in
specific category per store.
(5 points) Write main that reads number of stores and
3-digit positive
number - ID category. The program finds the average number of items in
that category.
Important: If you only wrote first function, write the following
main:
the program reads total number of items in the store and 3-digit ID
category and
finds the number of items in that category.