Assignment 6C: Overloaded Sorting. In class, we have primarily used integer arrays as examples when demonstrating how to
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Assignment 6C: Overloaded Sorting. In class, we have primarily used integer arrays as examples when demonstrating how to
Assignment 6C: Overloaded Sorting. In class, we have primarily used integer arrays as examples when demonstrating how to sort values. However, we can sort arrays made of other primitive datatypes as well. In this assignment, you will create three arrays of size 8; one array will be an integer array, one will be a char array, and one will be a float array. You will then ask the user to state what kind of data they want to sort-integers, chars, or floats. The user will then input 8 values. You will store them in the appropriate array based on what datatype they initially stated they would use. You will create a function called sortArray() that takes in an integer array as a parameter, and two overloaded versions of the same function that take in a char array and float array as parameters respectively. You will use these functions to sort the appropriate array and display the sorted values to the user. Note: You must make overloaded functions for this assignment- they must all be called sortArray(). You can not create unique, non-overloaded functions like sortArrayChars().