Assignment 5 Integer Array Class This assignment asks .docx - Assignment 5 Integer Array Class This assignment asks you to write a collection of little

Assignment 5 Integer Array Class This assignment asks .docx

This preview shows page 1 - 4 out of 7 pages.

Image of page 1
Assignment 5: Integer Array Class This assignment asks you to write a collection of little functions that all operate on an array of integers. In your test class, declare and initialize two literal integer arrays in main(), called sampleArray1 and sampleArray2 with the following values: int[] sampleArray1 = {4,7,9,3,2,8,15,6,8,7}; int[] sampleArray2 = {12,6,4,8,3,7,11,1,6}; You will use these arrays for testing your class later on. Implement a class called IntegerArray, that has only one variable in the class which is an array of ints, called arr. In your main function, create one or more instances of your IntegerArray class and call each of the following methods as
Image of page 2
you implement them. For methods that return a value, the code in main() should print the result of the call. In the IntegerArray class, only the printLiteral method should include calls to System.out. 1. Implement a constructor that takes the length and create an array of that length, but does not fill it. (See 2, below, for how to fill it.) 2. Implement a second constructor that takes an array of ints
Image of page 3
Image of page 4

You've reached the end of your free preview.

Want to read all 7 pages?

  • Fall '16
  • Christopher L. Litten, MA, Ph.D.

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors