Notes:
This IS a pair assignment. You MUST do the assignment with your partner.
You must complete an interview with a Lab Tutor for this PSA. Interviews are individual (partly to ensure that one partner doesn't do all the work). See instructions here for more details.
This work should be done in its own directory called 'psa8'. Instructions here.
This assignment has sample solution code that you can run on ieng6. You won't be able to see the java code itself =) but you will be able to do tests to see what it does, and make sure yours does the same thing. YOUR CODE MUST DO THE EXACT SAME THING. EXACT!! Wording, spaces, everything. Instructions on how to run the sample solution code are here .
Each file must have a header with the team members' names, logins, and PIDs. The header should also describe the program in 2-3 sentences.
This homework requires skills from Chapter 1 through Chapter 6.
Write a program that simulates a population of Amoebas who float around and absorb each other until there is only one left.
-bash2.05$ cp ~/../public/Circle.java ~/psa8/). You will be adding the following features to the Circle class:
-bash2.05$ cp ~/../public/AmoebaWorld.java ~/psa8/).





Start by creating a directory (folder) in your ieng6 cs8fzz account (this is necessary for the bundle script). After you log in, create a directory by typing the commands:Go into that directory (like double clicking to open a folder) with the command:-bash-2.05b$ mkdir psa8Note: you must name your directories (folders) and files as indicated in the problem descriptions for the turn in program to work.-bash-2.05b$ cd psa8
To run a sample of AmoebaWorld, since it has graphics, you will need to do something different and run the class directly. Do:
-bash-2.05b$ cd ~/../public/ -bash2.05$ java AmoebaWorld
The to return to your own directory, do "cd ~/psa8".
This assignment is worth 20 points.General (4 pts):
- 1 Point: For proper formatting. Your code is properly and consistently indented.
- 1 Point: For documentation. You must write a 2-4 sentence description of the program (as a comment) that provides insight into what the program does and what it's useful for. In this header comment, you are also required to put the author names, author PIDs and author logins
- 2 points: Interview (done individually) see instructions here
Circle.java (11 pts):
- 1 point: Add new instance variables and change constructor
- 2 points: Fill in isOutOfBoundsX() and isOutOfBoundsY()
- 1 point: Changes to setLocation() and setRadius()
- 1 point: Add isBiggerThan()
- 1 point: Add isCollidingWith()
- 1 point: Add toString()
- 2 points: Add move()
- 2 points: Add mergeWith()
AmoebaWorld.java (5 pts):
- 1 point: Instantiate amoebas
- 2 points: Move amoebas around the world
- 2 points: Colliding amoebas merge
When you are ready to turn in your homework, runbundle-psa8from yourpsa4directory. The session should look like this:-bash-2.05b$ cd ~/psa8 -bash-2.05b$ bundle-psa8 Good; all required files are present: Circle.java AmoebaWorld.java Do you want to go ahead and turnin these files? [y/n]y OK. Proceeding. Performing turnin of approx. XXXX bytes Copying to /home/linux/ieng6/cs8w/turnin.dest/cs8wzz.psa8 . Done. Total bytes written: XXXX Please check to be sure that's reasonable. Turnin successful.If you want to make changes after you've turned in your homework, make the changes and run
bundle-psa8again. The program will warn you that a "previously turned-in file exists" and ask if "you wish to over-write this existing file" (delete the old version and replace it with this new one). Respond in the affirmative by typingyand pressing theEnterkey.
10% of your grade on this assignment will come from an interview you will have with one of the tutors during Open Lab Hours. You have 48 weekday hours after the electronic turnin deadline to get your interview done. The deadline for the interview for PSA 5 is Monday, Feb 19, theoretically at midnight, but actually by the end of the last tutor hour scheduled. You get an interview by going into B260 during a scheduled tutor hour. Find the tutor, ask them if you can interview for PSA 5. If they have others who are waiting for interviews, your name will go on the end of the list of people waiting. Interviews take about 5 minutes each. It is your responsibility to go in early enough that you can get your interview completed. If everyone waits until the last hour on Wed, this will not work. The tutor will ask you to log in, change to the directory where your work is (psa8) and then to follow their directions. They will ask you to run your program to show that it works, open files in your favorite editor, and ask you questions about how your code works. Additionally, they may question you as to how you would (theoretically) make small changes to the program to have it do something slightly different. Learning to be able to explain your problem solving process and discuss code with another human being is a very important professional skill. We hope that this process will help you develop this skill.
Copying the assignment directory to partner's home directory
You can copy the psa8 directory and its files to your partner's home directory by:(don't forget the colon at the end of the command) where cs8wxx is your partner's username. You must be in the parent directory of the psa4 directory. So, you if you are currently in the psa4 directory you should execute
bash% scp -r psa8 cs8wxx@ieng6.ucsd.edu:"cd ..". Similarly, if the psa8 direcory is in your home directory then you have to be in your home directory. If you aren't there just execute"cd ~"and you'll be there. Your partner is required to enter his password when you enter the scp command. To check if the copy worked, your partner must login and ckeck if the psa8 directory exists in his home directory and if the proper files are located in it. This can be done by executing:"ls ~/psa8". The files in the psa4 directory should be listed.