Question: The local taqueria wants you to write a program which tracks the number of burritos they sell each day and help them analyze their business.

The local taqueria wants you to write a program which tracks the number of burritos they sell each day and help them analyze their business. Unlike last time, they don't know the types of burritos they will sell, or how many types of burritos there are, until the day of sale. Your main() should: - ask the user for the number of different burrito types sold - get the names of types from the user, e.g. "carnitas", "chicken", "vegetarian", etc., and ask the user for the number of burritos sold of each type of that day. To store all this, you must use two dynamically allocated arrays (i.e. use new to allocate memory for them, and delete [] to delete them when finished). You need one string array to store the names of the burrito types, and one int array to store the number of burritos sold.

Finally, create a function which will take a string pointer, an int pointer, and an int indicating the number of types as parameters.

void printReport(string *burritosPtr, int *salesPtr, int numTypes)

The string pointer burritosPtr points to the first element of an array of burrito type strings, the int pointer salesPtr points to the first element an array of sales per type, and the int numTypes is how many elements in each array. The function prints out a daily report listing sales for each burrito type and total number of burritos sold. Call this function from main() with your pointers to demonstrate their usage.

Hint: assuming variable numTypes contains the number of burrito types, here is how to dynamically allocate an array of type string with numTypes elements:

string *names = new string[numTypes]; 

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!