Docsity

Lab 1 Instruction - Structured Problem Solving Using the Computer | ITK 168.00, Lab Reports of Information Technology

Toggle sidebar
bg1
ITK 168
Fall, 2006
Lab 1 Instructions
Welcome to your first 168 lab session!
Completion of the lab exercises is very important in this course, because labs give you an
opportunity to make sure you understand the course material, and they give you a chance
to practice new skills before using them to write your larger lecture programs. Therefore,
you should take your lab work very seriously.
Note:
This set of instructions assumes that you are familiar with the Windows operating
systems and can copy files, run programs, etc. If that’s not the case, please get individual
help from your lab instructor.
Preparing for lab
In most cases, there will be one or more pre-lab exercises: work that you expected to
complete before coming to lab. At the beginning of each lab, your GA will look at your
prelab to be sure it is completed. Be sure to check the course website for the pre-lab
assignment well before your lab date so that you can complete the pre-lab work.
Your 168 log-in
Your lab instructor will provide you with a log-in id and a password for an account for
you to use for work for 168 only. Please do not change your password, and do not share
it with anyone. There is a generic log-in id that any student may use, but it will not give
you access to the H: drive.
The account will provide you with an H: drive: a portion of a networked hard disk
that you can access from the lab and from your dorm room or apartment. The purpose of
this is to give you a place to store your course work. You must not store anything else on
this disk (particularly not multi-media files of any kind).
The account also gives you access to a T: drive. This contains information provided
by instructors for various ITK courses. Any files that we provide you for lab will be
made available on the T: drive. You can copy things from the T drive, but you may not
modify anything on the T drive.
Do this:
Log on to the computer using your 168 id and password. Locate the T drive. On the T
drive, look in the folder itk168\Labs. You’ll find folders there for each week of lab.
Copy the Lab01 folder to your H drive.
Submitting your work
At the end of this document, you’ll find instructions for electronically submitting your
work. This is on its own sheet so that you can keep it safe throughout the semester.
Make sure that you correctly submit all programs and lab assignments. Lab assignments
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Lab 1 Instruction - Structured Problem Solving Using the Computer | ITK 168.00 and more Lab Reports Information Technology in PDF only on Docsity!

ITK 168 Fall, 2006

Lab 1 Instructions

Welcome to your first 168 lab session! Completion of the lab exercises is very important in this course, because labs give you an opportunity to make sure you understand the course material, and they give you a chance to practice new skills before using them to write your larger lecture programs. Therefore, you should take your lab work very seriously. Note: This set of instructions assumes that you are familiar with the Windows operating systems and can copy files, run programs, etc. If that’s not the case, please get individual help from your lab instructor. Preparing for lab In most cases, there will be one or more pre-lab exercises: work that you expected to complete before coming to lab. At the beginning of each lab, your GA will look at your prelab to be sure it is completed. Be sure to check the course website for the pre-lab assignment well before your lab date so that you can complete the pre-lab work. Your 168 log-in Your lab instructor will provide you with a log-in id and a password for an account for you to use for work for 168 only. Please do not change your password, and do not share it with anyone. There is a generic log-in id that any student may use, but it will not give you access to the H: drive. The account will provide you with an H: drive: a portion of a networked hard disk that you can access from the lab and from your dorm room or apartment. The purpose of this is to give you a place to store your course work. You must not store anything else on this disk (particularly not multi-media files of any kind). The account also gives you access to a T: drive. This contains information provided by instructors for various ITK courses. Any files that we provide you for lab will be made available on the T: drive. You can copy things from the T drive, but you may not modify anything on the T drive. Do this: Log on to the computer using your 168 id and password. Locate the T drive. On the T drive, look in the folder itk168\Labs. You’ll find folders there for each week of lab. Copy the Lab01 folder to your H drive. Submitting your work At the end of this document, you’ll find instructions for electronically submitting your work. This is on its own sheet so that you can keep it safe throughout the semester. Make sure that you correctly submit all programs and lab assignments. Lab assignments

should be submitted to your lab section (2, 3, 5, 6, 8, 9, 11, or 12) and programs should be submitted to your lecture section (1, 4, 7, 10). Do this: Using Notepad or any other appropriate software, write a short note to your lab instructor and save it as a .txt file named memo.txt. In your note, include the following information: Your name, your ulid, your lab section, your lab instructor’s name and answers to the following questions:

  1. What computer applications (if any) have you used enough to be comfortable with them?
  2. Do you have any programming experience? If so, what have you done?
  3. Do you have a computer? Submit your completed memo.txt file to your lab section following the Web Submit instructions. Working with programs in Eclipse Follow the instructions below. Refer to this section of the lab when you need to load, compile, or execute a program in later activities.
  1. Creating a project in Eclipse At the top of your desktop, there is a folder named Java tools. Open that folder, and double-click on the program labeled Eclipse (H drive). From the File menu, select New and then Project….

Type the name Lab1 into the Project Name textbox and click on the Finish button.

  1. Setting up a Robots project This part of the instructions applies ONLY to projects that use the Robots library supplied by your textbook author. The Robots library is a set of Java classes that provide a bunch of capabilities for robots and their worlds. In order to use the classes, you have to add the library to your project. To do this, right-click on the project folder for Lab1. From the pop-up menu, select Build PathAdd External Archives. Find the file becker.jar on the D drive in the java/jars folder and select it. That’s all there is to it. Remember, you must do this each time you create a project that uses the robot library. Otherwise, you will see a bunch of errors that can be very confusing.
  1. Importing a Java file into a project Now we want to load a Java file into our project in Eclipse. You’ll follow this procedure any time you are provided with a file that is to be part of your project. The file we’re going to import into Eclipse is called GoAroundRoadBlock.java. It should be on your H: drive, inside the Lab folder that you copied earlier. In your Eclipse window, make sure that the Lab1 project is selected. Then go to the File menu and choose Import… In the resulting dialog box, select File System and then click on the Next button In next dialog box, you’ll use the Browse button next to the From directory textbox to locate the folder in which the file is located. It’s very important that you’re looking for the folder the file is in, not the file itself. Although it’s confusing at first, this is actually a nice feature, because it allows you to import several Java files that are located in the same folder into a particular project.

This program is one of the example programs from chapter 1 of your textbook. Look at it closely. The first few lines set up the city, the walls, and the robots. The remainder move the robots around in the city.

  1. Running a Java program in Eclipse Computer programs aren’t very interesting until we make them actually run. To run a Java program in Eclipse, select the file you want to run a program from (in this case, GoAroundRoadBlock.java), and then go to the Run menu and select Run as and Java Application.

Alternatively, you can right-click on the file, and then select Run As and Java Application from the resulting pop-up menu. On your gradesheet, briefly describe what this program does (to show your lab instructor that you have successfully run the program).

  1. Modifying a Java Program The final task you’ll complete in this lab is to make a modification to a Java program. Look closely at the portion of the program that makes the robots move around. Modify that code so that the robots meet one block further south and on the east side of the roadblock (rather than west). Follow the directions above to run your program and make sure it works. Hints: After making changes to code, you must recompile the code. In order to do this, click the Save button. If Eclipse finds errors in your code, it will list the errors in the box at the bottom labeled Problems. Double clicking on a problem will cause the editor window to show you the line of code the problem is referring to. You will also see little symbols appear to the left of lines of code that have problems as you type. If the symbol includes a light bulb, you can right-click on the light bulb to get suggestions about ways to fix the error. Once your modified program is working correctly, follow the Web Submit instructions to submit the modified .java file to your lab section. Make certain that you submit the correct file. It will be located in a folder named “Work” on your H drive, inside the Lab1 folder. Don’t accidentally submit the original file that you copied from the T drive.

Step 3. Be certain that your instructor’s name appears on the second screen. Enter your ULID, select the correct project #, and browse to locate the file you are submitting. Click submit. If you find you have made a mistake, chose reset and start over. If you submit the wrong file or you decide to change something in your work, simply resubmit the correct file. Files with the same name will be overwritten. Step 4. Each time you submit you will receive an e-mail confirming that your file was received. Save this e-mail until you receive a grade on that assignment. IMPORTANT : If you do not receive a confirmation e-mail but you did submit a file, contact your instructor immediately. Check that the section number and instructor information is correct. Type your ISU ULID on this page. Choose the correct project number (for labs this matches the current lab week number and for programming assignments this matches the assignment number). Browse to the current location of your zipped folder. Press submit.

Name ____________________________ Lab 1 Participation _________ (15) ULID ____________________________ Lab 1 Activities _________ (15) Section _____________ Lab 2 Pre-lab/Participation _________ (15)

Lab 1 Grade Sheet

Lab 1 Activities (15 points)

__________ (5) Notepad memo submitted to your lab section __________ (5) Description of the behavior of the original GoAroundRoadBlock.java program . __________ (5) Modified GoAroundRoadBlock.java submitted to your lab section

Lab 2 Pre-Lab and Participation (15 points)

__________ (5) Pre-Lab __________ (10) Participation