CSE 115 - Spring 2007 - Introduction to Computer Science for Majors I |
|
Lab 2IntroductionWe have just begun to look at writing our own Java source code files in class. Writing those files can be an overwhelming task for students who are new to the task. You were just introduced to the lab environment in Baldy 21 and you worked briefly with Eclipse to edit a text file. In this lab, you will work a little more with Eclipse and work with the ideas we have been explored in class about the design of object oriented systems. You will build a simple program that uses the ideas we have been discussing so far in class. ObjectivesThe high-level objectives of this lab are to have you,
Assignment SpecificationsSometimes, even the most complex programs are simpler than they seem to create. In this lab, you will create a fairly sophisticated program using some pre-built components. In fact, this idea of taking components that are already built and using them to create a different program is central to how quite a bit of software is actually developed today. Most companies do not build all of their own software from scratch. Instead, they purchase bundles of software that gives them the required functionality that they need and the company uses and customized the software as appropriate. The only thing you are required to do for this lab is to have your program create an instance of a pre-built component named Helpful HintsRead through the entire lab before you start working, so that you know what to expect. Make sure you save your work often, and keep track of what you are expected to submit. Do not be afraid to refer to earlier labs to recall what things mean or what commands are available for you to use. ReadingMake sure you have read chapter 1 and chapter 2 of the book before coming to lab. Also make sure you have reviewed your lecture notes. It might also be helpful to begin looking at Chapter 1 of the Eclipse book. Lab set-up tasksAt your lab session your teaching assistant will briefly discuss how to carry out each of the set-up tasks below. She or he will also be available to answer questions you might have. Before you start work on the lab itself, you must carry out each of the following set-up tasks. Your teaching assistant will guide you through this process. If you are trying to do this lab from home, please consult this link. Step 1: Log inThe first thing you must do when you are in the lab is log in at the SunRay in front of you. Remember that this logs you into a machine named,
To get access to the prompt [recall that you need the prompt to type UNIX
commands], you use the In Lab 1, you should have created a directory for your workspace. You need
to ensure that you completed this task by executing the
Step 2: Start Eclipse Last time, you should have created an alias for Eclipse in your It might also be helpful to create a shortcut on your desktop for Eclipse. To do this: Right click on your desktop and get the following menu. Select Create Launcher: Then you will get the Create Launcher dialog. Make your Dialog look like the one below and click "OK": Now you will see an icon on your desktop for Eclipse. You can double-click on it to run Eclipse. Once you have started Eclipse, you might be prompted for which workspace you'd
like to work in. You should select If you haven't done so, be sure to check the box "Use as default and don't ask me again", and then click "OK".
Step 3: Import preferences fileNext you need do tell Eclipse a few things about how you want it to behave. This is a one-time process. In other words, once you have successfully carried out these steps you will NOT need to repeat them in lab. While working on Lab 1, you ran a script from the prompt. This script put
a file in your home directory named At the prompt, type To import the file, you will first need to open the Import dialog. Do this by selecting "Import..." from the "File" menu. It is common practice to abbreviate menu selections that you need to make in instructions like these. For example, we can abbreviate select "Import..." from the "File" menuby simply writing "File" -> "Import". This time we'll show the screen shot of the menu item being selected, but from now on we'll simply write menu selections using this abbreviated method. Your teaching assistant can help you if you have trouble locating the correct menu selections. An "Import" dialog window should appear. Select the + sign (or the > symbol depending on your OS) and expand the "General" Folder. Note that there is now an option for t "Preferences", as below. Select it and then click "Next". This opens up an "Import Preferences" dialog window. Browse to the file Step 4: Seeing the connections to code repositoriesIf you do not have a tab in the lower portion of your screen that says "CVS Repositories", you should open that View so that you can see what Repositories you have connections to. To do this, select Window -> Show View -> Other. You should then select to expand the entry for CVS and select CVS Repositories and click OK. You will now see a view tab on the bottom of your screen that shows which repositories you have access to: Step 5: Check out Lab2 project from LabSkeletons repositoryOpen the LabSkeletons repository (click on the "+" or triangle to the left of its name to "spin" it open). Open "Head", and then a dialog will pop up prompting you for your password. The password here is the same one you typed to log into the machine in Baldy 21. Type your password in and then click "OK". Then the files in the Lab Skeletons Repository will be visible. Select Lab2: Now right-click, and select "Check out". In the left-most pane you will now see the Lab 2 project in your workspace.
You should expand out the project to see what is inside it. You will notice
a package with a file named
Lab AssignmentBefore you begin on the actual work for this lab, let us begin by simply running the skeleton the way it is so that you can see what you've got. Right click on You should see a blank AppletViewer window appear:
The window is blank because you have not filled in the definition of the
If you now click "Run" you will see a large (but still blank) AppletViewer window. Exit from the AppletViewer again ("Applet" -> "Quit"). Now, to get the program to show us what it really can do, all we need to do is to create an instance of the Meet your Mentor (CSE 503 students are exempt from this part of the lab)The non-coding portion of this lab is to attend the first meeting that your mentor is having. The mentors have collected your schedules and will be finding a meeting time that works for them as well as the people in your mentor group. You should go to the meeting and find out what mentoring is all about and what kinds of information you can share as a group. Your mentor will record your attendance at this meeting and your attendance will be a portion of the lab grade for this lab. Your mentor will be in touch via email or through the course website. If you are having difficulty attending one of the mentor meetings from your recitation, please note the schedules of other mentor meetings. You can attend another mentor's meeting to gain credit for this portion of the lab. If you are having difficulties with this part of the assignment, please contact your instructor. Note: The first meeting may actually occur after this lab is due for you. You are still required to turn in the coding portion on time. You should then attend the meeting at its scheduled time. What you hand inWhen you are finished, you need to export your solution from the Eclipse environment so that you can submit it. You should now disconnect your completed project from the CVS repository from which you checked out the lab skeleton. To do this, right click on the project name, and select "Team" -> "Disconnect". In the "Confirm Disconnect from CVS" window that pops open select "Also delete the CVS meta information from the file system.", then click "Yes": Now it is time to package up your completed work to get it ready for submission. Right click on the project name, and select "Export...". An "Export" window will open. Under Java, select "JAR file":
Click "Next>". This brings up a new screen. Make your screen look like the one below: VERY IMPORTANT: MAKE SURE THAT THERE IS A CHECK IN THE BOX NEXT TO THE OPTION FOR EXPORT JAVA SOURCE FILES AND RESOURCES!!!!
Now you can submit the resulting jar file, Lab2.jar. This file should be in your home directory. To submit, you use the electronic submission program that corresponds to your recitation. For instance students in section A1 will submit by typing submit_cse115a1 Lab2.jar at the Unix prompt. If when you try to submit you get a message stating "submit_cse115XX:
Command not found." then you need to add the following line to your
And then type the same command at the prompt. The changes to your Due datesYou have one week from the meeting of your lab to submit your solution. For example, if your recitation meets on Tuesday, January 30th then you must submit the lab by 11:59 pm on Monday, February 5 th. The due dates are summarized in the table below. You are always welcome to submit early. If you submit more than once, the later submission will simply overwrite the previous one. To check that your lab was submitted, you can always refer back to the Submit Inspector on the Resources page of the website. After you have entered your user name, your submissions will be shown. Clicking on the name of a file that is a zip file will show you the contents of the zip file so you can verify that you indeed zipped up all the correct files.
|
Announcements | Labs | Meetings | People | Resources | Schedule | Syllabus |
Last modified: Thu Jan 25 18:09:56 2007 © Adrienne Decker |