CSCE 145 -- Spring 2008

Sections 4, 5, 6

Introduction to Algorithmic Design

Lab Assignments

Lab Assignment 1


Use Mozilla/Netscape/Internet Explorer to get to the lab instructions. You will probably want to set a bookmark at the class web page

http://www.cse.sc.edu/~buell/csce145/csce145_2008_1spring/csce145_2008_1spring.html .

From there you should navigate to the "Tests and Assignments" section and the lab assignments and homework assignments pages.

  • The laboratory computer systems run the Microsoft Windows XP operating system. Because each computer is connected to a server in the College (running Windows Server), you have a login, password, and a "profile" that can follow you around to whatever computer you use within the "engr" domain. Computer labs are located in Swearingen and 300 Main. All the labs have some scheduled times when they are used by classes (like the scheduled use of 1D15 for this class), but except for those times (which should be posted), the labs are available for use by all students in the college. If you do things correctly, any of the seven labs in Swearingen and 300 Main should be usable for this class.
  • However, and this is very important, you must "do things correctly" in order to have this interoperability. You have been provided by the college with virtual disk space on the network drive that is usually referred to as "the H: drive". You should always put your work on the H: drive, because your individual H: drive is stored on the college server and is accessible from any of the Wintel machines in any of the college labs and from your personal computer or laptop in your home. You should never put your work in the local C: drive of the computer or on the Desktop. Both of these are local to the individual machine and will not be visible if you move to a different machine. Further, if you put your lab work on the local drive, then some other student will be able to pick up that material, and you could be accused of assisting that student in an act of academic dishonesty. (Remember, you are the computer-astute people on campus, so it will be harder for you to plead ignorance than it would be for students in other programs.)
  • Login to the computer. Your login name should be the same as you were assigned by USC when you registered. Change your password. If you've never logged in before, your password should be your Student ID. A good password should be made up of a combination of letters, both uppercase and lowercase, and numbers. One way to get a reasonable password is to pick the first letter of each word of some line from a favorite song.
  • Note the Desktop (i.e., the appearance of the screen). Everyone's Desktop is identical now, but it's your Desktop. Take an inventory of the things on the Desktop. You can change it as you wish at your convenience.
  • What you need for CSCE 145 is primarily Internet Explorer, the Java compiler and libraries, the Eclipse Integrated Development Environment (IDE), and the textbook software. These are all free, and you can download and install them on any Wintel, linux, or Mac computer you have available to you. One reason we use these particular tools is that they are very common in the workplace and yet they require no particular licensing.
  • You are next going to place an icon on the desktop for eclipse. Locate the Eclipse folder by clicking on the Start menu, then Programs, CSE Apps, and eclipse. Click on the eclipse icon using the right mouse button. From the menu that appears, choose Send To and then Desktop (shortcut). This will place a shortcut to the Eclipse development environment on your Desktop for ease of use.
  • Double click on the My Computer icon to see what you have. In particular, there are several drives. The C: drive is the usual local drive. In addition, especially on the new computers in 1D11 and 1D15, there are a great many USB and other "drive" slots, more than on the computers in the other labs. You will want to use the Network Drive that will probably have a label like Z_buell$ on 'Fs' (H:). This is what we refer to as "the H: drive".
  • Open the H: drive by double-clicking on it. Create a new folder on H: called csce145; open the csce145 directory by double-clicking on it; now create a lab01 directory. Also create a Robots directory.
  • Open eclipse by double-clicking on its icon on the desktop. If the Welcome window appears, click on the icon for the Workbench; Eclipse will request that you Select a workspace. Either type in or browse to the H:\csce145 directory and click OK.
  • Use File/New/Project and then choose Java Project and click Next. In the window that pops up, choose a project name of lab01 and click Next or Finish.
  • Double click on lab01. Now click on Use File/New/Class. In the Name box, enter Main.
  • Two-thirds of the way down that dialog box, check that you wish to create the
    public static void main(String[] args)
    "method stub" and click Finish.
  • What you will see in the edit window of Eclipse is the template of a Java program, including the
    public static void main(String[] args)
    method stub that you specifically asked to have created for you in the previous step. On the line directly below the
    Auto-generated method stub
    line, enter
    System.out.println("hello, world");
    exactly as shown here.
  • You now have a complete Java program that reads
    public class Main {
    	/**
    	 * @param args
    	 */
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    		System.out.println("hello, world");
    	}
    }
    
    Click on File/Save. Then click on Run/Run As/Java Application.
  • You should see hello, world appear in the console window at the bottom of the Eclipse window. You have just run your first program in this class!
  • Once your program is working, you can exit Eclipse and then go to https://cse.sc.edu (note the difference of an extra s after http) and enter your user name and password. If you are logging in for the first time, the password will be your Student ID. After logging in, click and go to Dropbox Center and then Dropbox Student. Click on Browse to go to the location where you stored the lab (H:\csce145\lab01\Main.java) and click on the Open button. Then click the Upload button to upload the file. You will have to do this for all of your homework and lab assignments this semester. You should be able to verify that your file has been uploaded. If you cannot open the file you think you have uploaded, or if the system says that the number of bytes uploaded is zero, then you have not uploaded the file correctly and you need to try again.

Congratulations! You've just written and run your first CSCE 145 Java program.

Swearingen Engineering Center | Columbia, SC 29208 | 803.777.2880 | web@cse.sc.edu