Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

! sider the following statements that are contained in main: int [ JI JinStock new int [10][4] int [ alpha new int [20] int []beta

image text in transcribed
! sider the following statements that are contained in main: int [ JI JinStock new int [10][4] int [ alpha new int [20] int []beta new int [20] int [ 1gama (11, 13, 15, 17): int [ ] delta (3, 5, 2,6, 10, 9.7,11, 1,8): a. Write the definition of the method inputArray that prompts the user to input 20 numbers and stores the numbers in alpha. b. Write the definition of the method doubleArray that initializes the elements of beta to 2 times the corresponding elements in alpha. Make sure that you prevent the method from modifying the elements of alpha. Write the definition of the method copyGamma that sets the elements of the first row of inStock to gamma and the remaining rows of inStock to 3 times the previous row of inStock. Make sure that you prevent the method from modifying the elements of gamma. c. d. Write the definition of the method copyAlphaBeta that stores alpha into the first 5 rows of inStock and beta into the last 5 rows of inStock Make sure that you prevent the method from modifying the elements of alpha and beta. e. Write the definition of the method printArray that prints any one- dimensional array of the type int. Print 15 elements per line f. Write the definition of the method setInStock that prompts the user to input the elements for the first column of inStock. The method should then set the elements in the remaining columns to 2 times the corresponding element in the previous column, minus the corresponding element in delta. Write a complete Java program that tests the method main and all of the methods discussed in parts a through f. Remember to write Java statement that call each of the methods and format the output Use the following input for 20 integers 12345678912 3 45678912

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

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions