Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Assignment 1 – Loops and Arrays UNSW Blogs Home UNSW Wikispaces UNSW Website MyUNSW RSS COMP1400 – Programming for Designers Class announcements for Programming for Designers Assignment 1 – Loops and Arrays Posted by Claude on August 15th, 2013 · Assignments Due: 11:59pm Sunday 1 September (i.e. the end of week 5) This assignment is about loops arrays. You will write three methods to manipulate arrays. The first two are easy. The third one will require more thought about the design. You will submit the assignment using the CSE give system (see below). Download the BlueJ project, Assignment1.zip. It contains three methods. You have to write the code that goes inside them. Question 1 The first method finds the average of the elements of an integer array: public double average(int[] data) That is, given an integer array, data, calculate what the average of its elements are and return the average value. For example, the average of {1, 3, 2, 5, 8} is 3.8. Question 2 The second method is: public int countInRange(int[] data, int lo, int hi) For this, you have to count the number of elements of the array, data, that lie in the range lo to hi inclusive, and return the count. For example, if data is the array {1, 3, 2, 5, 8} then the call countInRange(data, 2, 5) should return 3 because there are three elements, 3, 2 and 5 that lie in the range 2 .. 5. Question 3 The third method, arrayAdd, takes two arrays as parameters and returns a new array that is the sum of the first two. public int[] arrayAdd(int[] R1, int[] R2) The addition of two arrays yields an array whose elements are the sum of the corresponding elements in the parameter arrays, i.e. R1[0] + R2[0], R1[1] + R2[1], R1[2] + R2[2], .... Submission instructions You will submit your assignment to the Give automated marked system. From within your assignment 1 BlueJ project, select Project -> Create Jar File… In the Dialog Box that appears: Set “Main Class” to none Ensure “Include Source” is checked Leave “Include Bluej project files” unchecked Press “Continue” Save the filename as “Assignment1.jar” Open a web browser and go to the give web site Log-in with you Z-Pass Either enter “COMP1400″ in for the course, or select COMP1400 from the drop down menu and press “Search for Assignments”. Note INFSi1609/2609 students may need to enter “COMP1400″ instead of selecting the course form the dropdown Select “assignment1″ from the next drop down menu and press “Upload my Assignment” Accept the student declaration Press “Choose File” and select the “Assignment1.jar” file that you saved in step 4 Press “Submit my Files” Wait for the page to completely load. Then carefully read the output. If the assignment is successful you should see the following lines: ================================================ Checking your submission... Checking for Assignment1.java Assignment1.java Compiled Sucessfully All files are OK ================================================ If the page doesn’t load properly, that is OK just submit the assignment file again. If you don’t get the above output check the output to see what went wrong and resubmit. Submission notes: You can submit as many times as you wish, even after the deadline. Only your last submission will be marked. Make sure you name everything the as instructed, including the classes and the submission file or the submission will not work. If you have any problems with submission, email the class account   Email to friend Stay updated Tags: No Comments so far ↓ There are no comments yet...Kick things off by filling out the form below. You must log in to post a comment. Pages Course Outline for Semester 2, 2014 For Tutors Lab Times Lecture Notes and Example Files Software Weekly Quizzes Search Categories Announcements Assignments Lab Lectures Uncategorized Links BlueJ web site Submit/Collect Assignments View Marks Staff Claude Sammut (Lecturer) Timothy Wiley (Admin/Tutor) Troy Lenger (Tutor) Sam Ipsen (Tutor) Meta Log in Entries feed Comments feed WordPress.org UNSW Blogs User Tools Username and Password:          Lost your password? COMP1400 – Programming for Designers Terms of Use Privacy Policy Copyright and Disclaimer Accessibility Acknowledgements UNSW Sydney NSW 2052 Australia Telephone +61 2 9385 1000 UNSW CRICOS Provider Code 00098G ABN 57 195 873 179 Design by jokay