



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Name : ___________________________________________________ Student Number : ___________________________________________________ Laboratory Time : ___________________________________________________ Instructions for the Laboratory Objectives
Task 1: Log in to ICS machines In order to complete laboratory exercises, you will need to be able to access the computers in the ICS labs. If you have not used the lab computer before you will need to have an account created and passwords set up by ICS Computer Support. The lab assistant in ICS 364 or the offices nearby can help with this. a) Know your ICS user ID b) Know your ICS Windows password c) Know your ICS UNIX password
In order to do this, you will need to use the following features in the JDT. a) Create a new Java project b) Create a new Java package c) Create a new Java class There are a number of ways to do this—the menu bar (File - > New), the context menu (right mouse button), and the Button bar. As you are working with the JDT, you should notice the kinds of automation that is build in to the tool. What kinds of warnings do you get about the names for the project, package, and class? Also, take a look at Content Assist, which provides hints about the Java API. If you need additional assistance, see the Help menu. Grading: Show the TA the output from your program. Task 4: Create a new project from existing source code Start by unzipping the file provided to you on the webpage, in your Eclipse home directory. You should have the following files:
b) Check that the Project - > Build Automatically menu item is selected. c) Click on the problems tab in the bottom right panel. You can see that there are some warnings generated. These all indicate that some variables or packages are not used. This is not the sort of warnings you should be bothered by. The TA will explain to you the difference between warnings, critical warnings and errors. d) Click on the GUIEnvironment.java file, which contains the only main() method, and select Run - > Run As.. - > Java Application. Grading: Show the TA that you created a new project from existing source code. Task 5: Do a simple Refactoring Now that the application is running, take a look at some of Eclipse’s refactoring features. a) Open the GUIEnvironment.java file and select the lines between between the comments “Begin section to be refactored” and “End section to be refactored.” Right click on these highlighted lines and select Refactor - > Extract Method. Fill in the method name printInstructions in the dialog box and select the OK button. The highlighted lines are replaced with a call to the newly created method printInstructions(g2) and the highlighted lines make up the body of this new method. b) Select all the java files in (default package) in the Package Explorer View and select Refactor - > Move. In the Move window, click on the Create Package button. Fill in the name for the package: edu.uci.ics.inf111.lunarlander and select the Finish button. Select the package edu.uci.ics.inf111.lunarlander and select the OK button. You will see that all the java classes belong to the created package. c) Select the GUIEnvironment.java file in the Package Explorer View and select Refactor - > Rename. Fill in a new name of the Java element in the Rename dialog box and select the Finish button. Grading: Show the TA your refactored code. Take Home
**1. Discuss similarities and differences between Prototyping and Incremental Development process. (20 points)