IN Java 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() In Java 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.0, 3.4, 8.4, 8.6, 10.3, 90.2, Sample Output #1: [Overloaded 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: a, b, c, e, f, x, y, z

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Modularization Techniques
Section: Chapter Questions
Problem 2GZ
icon
Related questions
Question

IN Java

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()

In Java

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.0, 3.4, 8.4, 8.6, 10.3, 90.2,
Sample Output #1:
[Overloaded 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:
a, b, c, e, f, x, y, z

Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage