C++ PROGRAMMING Develop a program that will sort the elements of a single dimension array.  Program Requirements: 1. Declare a single dimension array of size n 2. Input n elements to a single dimension array 3. Sort the elements of an array from highest to lowest and vice versa Also, the program will identify and output the highest and lowest integer.   Sorting Arrays Number of items to sort: 10 Enter elements              10       0      5        13       -10     20      -89      101      96      3 Lowest  _>  Highest              -89   -10     0         3          5       10       13         20      96      101 Highest _> Lowest              101     96    20      13        10        5       3           0         -10      -89                               Highest = 101                 Lowest = -8     Questions:    1. What is the algorithm used to sort elements of array in ascending and descending order?   2. How many integer arrays were used in this program?   3. Can this program be done with only 1 integer array being used? Explain your answer.   4. Explain how was the program able to determine the highest and lowest element.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.1: One-dimensional Arrays
Problem 10E: (Electrical eng.) Write a program that specifies three one-dimensional arrays named current,...
icon
Related questions
Question

 

C++ PROGRAMMING

Develop a program that will sort the elements of a single dimension array.

 Program Requirements:

1. Declare a single dimension array of size n

2. Input n elements to a single dimension array

3. Sort the elements of an array from highest to lowest and vice versa Also, the program will identify and output the highest and lowest integer.

 

Sorting Arrays

Number of items to sort: 10

Enter elements

             10       0      5        13       -10     20      -89      101      96      3

Lowest  _>  Highest

             -89   -10     0         3          5       10       13         20      96      101

Highest _> Lowest

             101     96    20      13        10        5       3           0         -10      -89

 

                            Highest = 101                 Lowest = -8

 

 

Questions:

 

 1. What is the algorithm used to sort elements of array in ascending and descending order?

 

2. How many integer arrays were used in this program?

 

3. Can this program be done with only 1 integer array being used? Explain your answer.

 

4. Explain how was the program able to determine the highest and lowest element.

Expert Solution
steps

Step by step

Solved in 6 steps with 5 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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,