Project 15 question

5 views
Skip to first unread message

Sean Hill

unread,
Jul 29, 2011, 4:37:23 PM7/29/11
to BYU 142 Summer 2011
What does this mean?

Create a driver to show on several examples that it works on arrays of
integers.

If we have a class that implements a bubble sort, and then call it in
the driver class, is that what it means?

Sarah Morley

unread,
Jul 29, 2011, 4:44:29 PM7/29/11
to byu-142-s...@googlegroups.com
Sure. You could have a separate class that has a method in it for doing bubble sort. Then make a driver with 3-5 int arrays of your own creation to test your bubble sort. Or you could just have one class with a separate method for bubble sort under your void main. Either way is fine.

Sarah

Grant

unread,
Jul 29, 2011, 7:01:54 PM7/29/11
to BYU 142 Summer 2011
Okay so if I create 3 - 5 int arrays of my own choosing, is it okay if
I just repeat the code in my driver for all three of them?

Lane - TA

unread,
Jul 29, 2011, 9:45:16 PM7/29/11
to byu-142-s...@googlegroups.com
I wouldn't recommend repeating the code every time to sort each array. You should probably make a bubble sort method that passes in an array of integers. That way you can just make a few arrays, call bubble sort on each one, then print out the result.
Reply all
Reply to author
Forward
0 new messages