{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Activity_08_pics - COMP 1210 Activity 8 Arrays Due...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
COMP 1210 Activity 8: Arrays COMP 1210 | Spring 2012 1 Due: Activity (in-lab) Monday, March 5, 2012 by the end of lab Goals: By the end of this activity you should be able to do the following: Understand the basics of instantiating arrays and assigning / accessing array elements. How to iterate through arrays using loops. Description: In this activity, you will create a class called Scores that will hold an array of numerical values and provide methods that allow users to interact with the Scores class. Directions: Part 1: Scores - method stubs Create a class called Scores. Add method stubs for the following methods . The first two are given; do the rest on your own . o The constructor has a parameter that references an array of int values o findEvens: no parameter, returns an array of ints (all of the even-valued scores) o findOdds: no parameter, returns an array of ints (all of the odd-valued scores) o calculateAverage: no parameters; returns a double (the average of all scores) o toReverseString: no parameters; returns a String (all scores in reverse order) o toString: no parameters; returns a String (all scores) Compile Scores and run the following in interactions.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}