Read data from one array and sort elements in ascending order, and sum up two consecutive elements of the array and store them in other array. (a) Read data from one array called array and sort elements in ascending order. (b) Sum up two consecutive elements of the sumUpArray and print the results. (c) The sample output format is as follows: C:\Users\janna\Desktop\Programming in Java\Mid Term Exam\Q4>java SortArray Sorted Array [-999, -9, -3, 0, 1, 2, 8, 9, 10, 22, 43, 55, 100, ] Add up two consecutive elements of array.. sumUpArray [0]: -1008 sumUpArray[1]: -12 sumUpArray[2]: -3 sumUpArray[3]: 1 sumUpArray [4]: 3

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 40SA
icon
Related questions
Question
Read data from one array and sort elements in ascending order, and sum up two consecutive elements
of the array and store them in other array.
(a) Read data from one array called array and sort elements in ascending order.
(b) Sum up two consecutive elements of the sumUpArray and print the results.
(c) The sample output format is as follows:
C:\Users\janna\Desktop\Programming in Java\Mid Term Exam\Q4>java SortArray
Sorted Array [-999, -9, -3, 0, 1, 2, 8, 9, 10, 22, 43, 55, 100, 1
Add up two consecutive elements of array..
sumUpArray [0]: -1008
sumUpArray[1]: -12
sumUpArray[2]: -3
sumUpArray [3]: 1
sumUpArray [4]: 3
sumUpArray [5]: 10
sumUpArray [6]: 17
sumUpArray [7]: 19
sumUpArray [8]: 32
sumUpArray [9]: 65
sumUpArray[10]: 98
sumUpArray [11]: 155
Transcribed Image Text:Read data from one array and sort elements in ascending order, and sum up two consecutive elements of the array and store them in other array. (a) Read data from one array called array and sort elements in ascending order. (b) Sum up two consecutive elements of the sumUpArray and print the results. (c) The sample output format is as follows: C:\Users\janna\Desktop\Programming in Java\Mid Term Exam\Q4>java SortArray Sorted Array [-999, -9, -3, 0, 1, 2, 8, 9, 10, 22, 43, 55, 100, 1 Add up two consecutive elements of array.. sumUpArray [0]: -1008 sumUpArray[1]: -12 sumUpArray[2]: -3 sumUpArray [3]: 1 sumUpArray [4]: 3 sumUpArray [5]: 10 sumUpArray [6]: 17 sumUpArray [7]: 19 sumUpArray [8]: 32 sumUpArray [9]: 65 sumUpArray[10]: 98 sumUpArray [11]: 155
Expert Solution
steps

Step by step

Solved in 4 steps with 3 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++ 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