Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Java METHODS: Create the method named initializeArray that receives an array type integer, initializes it with 0, and returns it. Create the method initializeArray

Using Java

METHODS: Create the method named initializeArray that receives an array type integer, initializes it with 0, and returns it. Create the method initializeArray that receives an array type String, initializes it with null, and return it. Create the method displayArrraythat receives an array of type integer and display it. Create the method displayArrraythat receives an array of type String and display it. Create the method sumElementsthat receives and array of integer and returns the sum of all of its elements. Create the method largestElementthat receives an array of integer and returns the larges integer from the array. Create the method smallestElementthat receives an array of integer and return the smallest integer from the array. Create the method smallestIndexOfLargestElementthat receives an array and return the smallest index of largest element from the array. Create the method smallestIndexOfSmallestElementthat receives an array and return the smallest index of smallest element from the array. Create the method shiftArrayElementsthat receives an array type integer and return the shifted array one position to the right and filling the first position with the last element. Create the method reverseArraythat receives an array type integer and returns its reverse. Create the method sortArrayAscendentthat receives and array and returns it sorted in ascending order. Create the method sortArrayDescendentthat receives and array and returns it sorted in descending order. Create the method twoDimArrayInitializethat receives two-dimensional array and returns it initialized with 1s. Create the method DisplayTwoDimArraythat receives two-dimensional array type integer and display its elements in the form of matrix.

MAIN METHOD: In the main method, implement a program that accepts any number of input type integer until the letter S or s (from stop) is entered. Insert all the inputs in an array of integers and display a menu informing the user the commands to enter. When a letter I or i is entered, the program should display an initialized array. When a letter S or s is entered, the program should display an integer that is the sum of all the numbers entered. When a letter L or l is entered, the program should display an integer that is the largest element entered. When a letter M or m is entered, the program should display an integer that is smallest number entered. When a letter X or x is entered, the program should display the smallest index of largest element in the array. When a letter Y or y is entered, the program should display the smallest index of smallest element in the array. When a letter F or f is entered, the program should display the entered numbers shifted one position from the order that was entered. When a letter R or r is entered, the program should display the numbers in the reversed order that was entered. When a letter A or a is entered, the program should display the entered numbers in ascending order. When a letter D or d is entered, the program should display the entered numbers in descending order. When a letter T or t is entered, the program displays the elements of two-dimensional array in the form of matrix.

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

Step: 3

blur-text-image

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

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

Is it clear what happens if an employee violates the policy?

Answered: 1 week ago