This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: ASSIGNMENT 3 Methods, Arrays, and the Java Standard Class Library COMP-202B, Winter 2010, All Sections Due: Wednesday, March 3, 2010 (23:55) You MUST do this assignment individually and, unless otherwise specified, you MUST follow all the general instructions and regulations for assignments. Graders have the discretion to deduct up to 10% of the value of this assignment for deviations from the general instructions and regulations. Part 1, Question 1: 0 points Part 1, Question 2: 0 points Part 2, Question 1: 40 points Part 2, Question 2: 60 points 100 points total Part 1 (0 points): Warm-up Do NOT submit this part, as it will not be graded. However, doing these exercises might help you to do the second part of the assignment, which will be graded. If you have difficulties with the questions of Part 1, then we suggest that you consult the TAs during their office hours; they can help you and work with you through the warm-up questions. Warm-up Question 1 (0 points) Create a file called MyNumbers.java which contains a class called MyNumbers . This class should define a public and static method called reverse() , which takes as its only parameter one value of type int , and returns a value of type int representing the reverse of the parameter value. For example, if the value stored in the parameter is 135 , then the value returned by the method will be 531 . You MAY assume that the parameter value does not contain any leading or trailing zeroes. Warm-up Question 2 (0 points) Create a file called MyTools.java which contains a class called MyTools . This class should define a public and static method called display() . This method takes as its only parameter an array of double s and returns nothing. This method displays the values stored in the array of double s it takes as parameter to the screen. Part 2 (40 + 60 = 100 points) The questions in this part of the assignment will be graded. 1 Introduction The Java standard class library provides a variety of classes. Some of these classes, such as the Math and Arrays class, provide various class methods which perform common tasks. Your task for this assignment will consist of writing classes that provide methods which are similar to those provided by the Math and Arrays classes, therefore allowing you to gain some insight on how these two classes work. Note the following: • You do NOT have to write a main() method in any of the classes you are required to write for this assignment; instead, you can test your methods using the provided test programs. • In addition, NONE of the methods that you are required to write for this assignment read input from the keyboard or display output to the screen. • The methods you are required to write for this assignment MUST call the other methods you are required to write for this assignment whenever doing so is useful....
View Full Document