Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. write a class and name it ArrayOpsThe class will have: a. One static method named main. b. One instance field named data of type

image text in transcribed
image text in transcribed
1. write a class and name it ArrayOpsThe class will have: a. One static method named main. b. One instance field named data of type integer array c. Write one constructor called ArrayOps with one argument: an array. Make a deep copy of the array Three instance methods: toString, reverse and findMin d. 2. There will be one static method named "main" (as in all the previous lab assignments). Copy and past the main method given here into your class: public static void main( String [] args) int [] input { , 1, -2, -3, 4, 5, -6, -7, 8, 9 }; Arrayops testobj = new Arrayops( input ); // constructor System.out println( "nobject's index for the smallest value is: + testobj.findMin)"n" // 1. Reference the tostring-method and print the array. /1 2. Reference the reverse-method to the array order // 3. Reference the tostring-method to display the reversed /Iarray /1 4. Reference the findMin-method to return the index of // the smallest value stored in the reversed array: // int mindex=? System.out.println( "Inobject's index for the smallest value after reverse is: " + mindex "; 3. Create a private instance field named data of type int-array in your class. . Write the constructor ArrayOps with one argument. Use the input argument to create a deep copy of the input array. The variable name "data" is the reference to the deep copy write a method called toString. This method has formal parameter inputs and returns a String. The returned string will contain the values in the instance field array as a String. 5

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

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago