Lab6 - Lab 6 Assigned 10/30, due 11/11/11 at 11 pm. In this...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Lab 6 – Assigned 10/30, due 11/11/11 at 11 pm. In this lab, you will create a single array of values, and sort them in ascending order, using a “bubble sort”. A bubble sort is where you take every item in a list, and compare it to every item further down the list, and swap them if the first item is “greater than” the second. The items end up in ascending order. “Greater than” can mean numerically in value, or alphabetically if the items are strings. To prepare for this lab, please read the lecture on Pointers. Also, chapter 4 of the text, pages 144-172 covers pointers extensively. Step 1: Create an array of strings. In this case, you must create the array using a character pointer to the first value. The example given in class is Make your array 25 items long. Use anything but birds: family names, song names, movies, books, etc. Step 2: Create a printMenu function that will display the operator choices (as we’ve done many times before). The choices should be “Print the array in current order”, “Sort the array”, and “Exit”.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Lab6 - Lab 6 Assigned 10/30, due 11/11/11 at 11 pm. In this...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online