Lab 10

Due: Thu, May 3, 11:59 pm

Programming Projects 5, 7, and 8 on pages 807-8.(100+100+50 pts)

For project 5, the second function should take a string argument (not a C-string). You will need to convert this string argument to a C-string using the c_str member function. Then, you will need to convert a C-string to a string object by using a constructor (whose argument is a C-string).

For Project 7, all the functions you use in sorting (including finding index_of_smallest, if you use it) must be recursive; you cannot use any loops. If you do this by modifying the sort function from Chapter 7, it would be easier to use 3 arguments for the sort function (instead of 2).

Note: Writing a reasonable test program and providing a good user interface is part of the assignment.

As usual, you will be graded on the following criteria: fulfillment of all requirements in problem statements, correct output, good user interface, good coding style and formatting.

Bonus: Due 11:59 pm Sun May 6. Do project 8 with a graphical illustration of all moves of the disks during the execution of the algorithm ( if you can do this with 3 disks, that will be good enough). As an additional bonus problem, write an iterative solution to Towers of Hanoi problem (as opposed to recursion).

Note: If you do any of the bonus problems, you must create a folder labelled "Bonus" and save all of your programs there.