Create an array of 15 integers. Add all elements located at ODD index positions and sum also all numbers located at EVEN(Assume index O is even) index positions in the linear array. The user's will be the one to input each item in the array of 15 elements. Display also the inputted integers in the array. Given the sample layout w/ test data below: Sample input/output: Enter 15 integers in the array: Num(0]: 10 Num[a]: -5 Num(2): 15 Num[3): 20 Num[4]: 2 Num[5): 9 Num(6): -3 Num[7): 25 Num[8): 30 Num(9):-18 Num[10]:-10 Num[11]: 7 Num[12]: 18 Num[13]: 1 Num[14]: 9 Inputted elements in the ARRAY are: Num(0): 10 Num[1]: -5 Num[2): 15 Num[3): 20 Num[4]: 2 Num(5): 9 Num(6): -3 Num[7): 25 Num(8): 30

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question
Create an array of 15 integers. Add all elements located
at ODD index positions and sum also all numbers located at EVEN(Assume
index 0 is even) index positions in the linear array. The user's will be
the one to input each item in the array of 15 elements. Display also
the inputted integers in the array.
Given the sample layout w/ test data below:
Sample input/output:
Enter 15 integers in the array:
Num[0): 10
Num(1]: -5
Num[2): 15
Num[3): 20
Num[4]:
Num(5): 9
Num(6): -3
Num[7]: 25
Num[8]: 30
Num[9]:-18
Num[10]:-10
Num[11]: 7
Num[12]: 18
Num[13]: 1
Num[14]: 9
Inputted elements in the ARRAY are:
Num(0): 10
Num[1]: -5
Num[2]: 15
Num[3]: 20
Num[4]: 2
Num[5): 9
Num[6]: -3
Num[7]: 25
Num[8]: 30
Num[9]:-18
Num[10]:-10
Num[11]: 7
Num[12]: 18
Num[13]: 1
Num[14]: 9
Transcribed Image Text:Create an array of 15 integers. Add all elements located at ODD index positions and sum also all numbers located at EVEN(Assume index 0 is even) index positions in the linear array. The user's will be the one to input each item in the array of 15 elements. Display also the inputted integers in the array. Given the sample layout w/ test data below: Sample input/output: Enter 15 integers in the array: Num[0): 10 Num(1]: -5 Num[2): 15 Num[3): 20 Num[4]: Num(5): 9 Num(6): -3 Num[7]: 25 Num[8]: 30 Num[9]:-18 Num[10]:-10 Num[11]: 7 Num[12]: 18 Num[13]: 1 Num[14]: 9 Inputted elements in the ARRAY are: Num(0): 10 Num[1]: -5 Num[2]: 15 Num[3]: 20 Num[4]: 2 Num[5): 9 Num[6]: -3 Num[7]: 25 Num[8]: 30 Num[9]:-18 Num[10]:-10 Num[11]: 7 Num[12]: 18 Num[13]: 1 Num[14]: 9
Expert Solution
steps

Step by step

Solved in 3 steps with 1 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 Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage