Question: TASK I: Create Parallel Arrays Begin by creating three parallel arrays populated with the following data (be careful with your data entry!). Give your arrays

TASK I: Create Parallel Arrays

Begin by creating three parallel arrays populated with the following data (be careful with your data entry!). Give your arrays meaningful names, such as cakes, prices, and days.

CAKE PRICE ORDER TIME (DAYS)

---- ----- -----------------

Red Velvet Supreme $29.95 1

Death by Chocolate $44.95 2

Molten Lava Chocolate $49.95 2

Unicorn Rainbow Cake $24.95 1

Warm Pumpkin Spice $29.95 1

Blueberry Cheesecake $34.95 2

English Pudding Cake $29.95 2

Salted Turtle Cake $39.95 2

Hot Fudge Sundae $24.95 1

Funfetti Sprinkles $19.95 1

TASK II: Bubble Sort

Code a bubble sort to sort the cakes lowest to highest according to price. When you swap, dont forget to swap elements across all three parallel arrays!

TASK III: Display and Average

Write a loop to 1) loop through and print the sorted cake data in parallel and 2) accumulate a running total, which you will later (i.e., after the loop) divide to get an average price for the cakes.

Use setw to get your columns to line up. Also note the hard-coded dollar signs on the prices and the average.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To tackle this programming assignment well break it down into tasks to ensure clarity and precision TASK I Create Parallel Arrays Well create three pa... View full answer

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!