Question: Write a program with a main method that asks the user to enter an array of 10 integers. Your main method then calls cach of

 Write a program with a main method that asks the user

Write a program with a main method that asks the user to enter an array of 10 integers. Your main method then calls cach of the three methods described below and prints out the results of the two methods which return values (sec format below). printTriples - a void method that prints out triples of the elements of the array (scc output format below). getSum - an int method that returns the sum of the array. getEven - a method that returns an array of integers which contains only even clements of the array (see the sample output below). Sample output: Enter a number: Enter a number: Enter a number: 88 Enter a number: 43 Enter a number: 14 Enter a number: 22 Enter a number: 17 Enter a number: Enter a number: Enter a number: Here are the triples: 39,66, 264. 129. 42, 66, 51, 18. 15. 12 The sum of the array is 234 The even elements of the array are: 122. 88. 14. 22. 6.41

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!