Question: In this assignment, you will continue working on your application. In Week 4, you used 2 arrays to represent the list of products and their

In this assignment, you will continue working on your application. In Week 4, you used 2 arrays to represent the list of products and their quantities. Memory needs were determined before program execution. This week, you will use dynamic allocation so the memory needs are determined during runtime. The functionality of the program is not expected to change. For this assignment, no sample code or template is provided. You need to complete it based on your previous work. Create a new C++ empty project titled "CS115_IP5_YourName" in the IDE. For the quantities, use a pointer to the first item of an array of int. An example of the declaration code may look like the following: For the products, use an array of pointers to strings, and dynamically allocate space for each of the strings. An example of the declaration code may look like the following: To fill in the products array, read one product name from the user, check the length, and then allocate memory based on the length of the entered word. The following code is provided as an example: Use the previous structure to provide the same functionality that was provided in Week 4. Complete the following in your code: Provide a list of available products Ask the customer to select products and quantities Save the provided details in the new data structure Read from the arrays to print the order summary; that is, the products, quantities, and the total price for each product Calculate and print the total price for the order Release the allocated memory Compile and run the application to demonstrate a working program. Insert the screenshots into a Word document, and add a short explanation on each screenshot. Finally, save your Word document as yourname_IP4.docx. Click the Edit button on this submission node to submit the saved document.

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!