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(). Sample Output #1: [Overloaded Sort] What data type do you want to enter? float Value 1: 3.4 Value 2: -1.0 Value 3: 2.0 Value 4: 10.3 Value 5: 90.2 Value 6: 8.4 Value 7: 8.6 Value 8: -2.3 Calling sortArray().. The sorted values are: -2.3, -1.0, 2.ө, з.4, 8.4, 8.6, 10.3, 90.2, Sample Output #1: [Over loaded Sort] What data type do you want to enter? char Value 1: a Value 2: c Value 3: f Value 4: b Value 5: e Value 6: z Value 7: x Value 8: y Calling sortArray()... The sorted values are: а, b, с, е, f, х, у, z

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Language is C++ 

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().
Sample Output #1:
[Over loaded Sort]
What data type do you want to enter? float
Value 1: 3.4
Value 2: -1.0
Value 3: 2.0
Value 4: 10.3
Value 5: 90.2
Value 6: 8.4
Value 7: 8.6
Value 8: -2.3
Calling sortArray()...
The sorted values are:
-2.3, -1.0, 2.0, 3.4, 8.4, 8.6, 10.3, 90.2,
Sample Output #1:
[Over loaded Sort]
What data type do you want to enter? char
Value 1: a
Value 2: c
Value 3: f
Value 4: b
Value 5: e
Value 6: z
Value 7: x
Value 8: y
Calling sortArray()...
The sorted values are:
а, b, с, е, f, х, Y, z
Transcribed Image Text: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(). Sample Output #1: [Over loaded Sort] What data type do you want to enter? float Value 1: 3.4 Value 2: -1.0 Value 3: 2.0 Value 4: 10.3 Value 5: 90.2 Value 6: 8.4 Value 7: 8.6 Value 8: -2.3 Calling sortArray()... The sorted values are: -2.3, -1.0, 2.0, 3.4, 8.4, 8.6, 10.3, 90.2, Sample Output #1: [Over loaded Sort] What data type do you want to enter? char Value 1: a Value 2: c Value 3: f Value 4: b Value 5: e Value 6: z Value 7: x Value 8: y Calling sortArray()... The sorted values are: а, b, с, е, f, х, Y, z
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 8 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY