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.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

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 2RQ
icon
Related questions
Question

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.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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Arrays
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning