Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

explain what is meant by redundancy

Answered: 1 week ago