{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

a3

a3 - ASSIGNMENT 3 Methods Arrays and the Java Standard...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
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
Image of page 1

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

View Full Document Right Arrow Icon
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.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

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