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]; I will leave it to you to figure out how to dynamically allocate an array of type int with numTypes elements.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter2: Using Data
Section: Chapter Questions
Problem 4E: In this chapter, you learned that although a double and a decimal both hold floating-point numbers,...
icon
Related questions
icon
Concept explainers
Question
100%

Write a C++ program. NO SAMPLE OUTPUT AVAILABLE

 

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];

I will leave it to you to figure out how to dynamically allocate an array of type int with numTypes elements.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning