Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Average cost of cake at Sweet Dreams: 32.95

Thank you for your order. Enjoy!

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 the output below as your guide. Use setwto get your columns to line up. Also note the hard-coded dollar signs on the prices and the average.

Output:::::

CAKE PRICE ORDER TIME (DAYS)

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

Funfetti Sprinkles $19.95 1

Unicorn Rainbow Cake $24.95 1

Hot Fudge Sundae $24.95 1

Red Velvet Supreme $29.95 1

Warm Pumpkin Spice $29.95 1

English Pudding Cake $29.95 2

Blueberry Cheesecake $34.95 2

Salted Turtle Cake $39.95 2

Death by Chocolate $44.95 2

Molten Lava Chocolate $49.95 2

Average cost of cake at Sweet Dreams: $32.95

Thank you for your order. Enjoy!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

1. How do most insects respire ?

Answered: 1 week ago

Question

Who is known as the father of the indian constitution?

Answered: 1 week ago

Question

1.explain evaporation ?

Answered: 1 week ago

Question

Who was the first woman prime minister of india?

Answered: 1 week ago

Question

Explain the concept of going concern value in detail.

Answered: 1 week ago