CS 302 Lab 1

Lab 1: Introduction to Programming in the CS Instructional Labs

CS 302, UW-Madison


What we'll cover today:


Getting Started

Your Lab TAs have helped you get to this point, but from here you can continue working at your own pace with your partner by following this lab write up. If you have any questions, please feel free to ask your Lab TA for help.

These computer labs are taken care of for us by people of the Computer Systems Lab (CSL). There are a few easy things you can do to help them:


Task 1: Exploring the Course Resources


Your CS Account

As a registered CS 302 student, you are provided an account on the CS lab machines. Note that your CS username (and password) might not be the same as your UW netid. Make sure you remember them. Having a CS account also gives you an email address (yourusername@cs.wisc.edu) and webspace (cs.wisc.edu/~yourusername). Ask your Lab TA if you have any interest in using either one. If we send any email it will be sent to your UW email account rather than your CS email account.


Your L: Drive

Your CS acount also provides you with space to save your Java files on your L: drive. When working on the lab computers, make sure to save your files on the L: drive. Do not save them on the C: drive since other people can access files you put there. Also make sure to save your files in the private folder of your L: drive and not the public folder since anyone can read files in public. We'll show you how to do this in the Eclipse tutorial later today.


Working with a Lab Partner

Working with others is a important skill not only in CS but in most endeavors. Part of your lab grade will be based on your cooperation with your lab partner. We'll assign you a different lab partner every three to four weeks so that you can gain experience working with others. You'll likely encounter some challenges working with partners that are different than you, given the diverse group of students in CS 302. To make lab sections a good learning experience for both lab partners please remember to:


Shortcuts

It's a good idea to be able to do things efficiently in this course. Keyboard shortcuts are an important step. The following are absolutely worth learning, and we suspect many of you already know these:

You can find them on various menus if you forget:

It also wouldn't hurt to know that double clicking a word highlights it and these shortcuts too:


The CS 302 Course Website and Firefox

As you've probably discovered, Firefox is a web browser, very similar to Internet Explorer. Both browsers are installed on these machines, but you should use Firefox.

While Internet Explorer is designed for people that don't know how to use computers, Firefox is designed for people that want the computer to do exactly what they tell it to. Firefox is a free program, so if you like it, get it from here.

Next, spend some time exploring the course website (http://www.cs.wisc.edu/~cs302/) and become familiar with the information available by checking out the links in the CS 302 menu (on the left side).

Any information that is specific to your lecture (as opposed to the course as a whole) will be posted on your lecture's home page. To get to there, click on your lecture number under the list of large and small lectures. This will take you to your lecture's home page, and notice another link now appears in the menu:

Most of your questions can be answered by the information on these pages. Make sure you check them out before emailing your instructor. Take about 10-15 minutes to take a look:

Next:


Task 2: Eclipse

Next explore Eclipse, the integrated development environment (IDE) that we use in CS 302 (which is available for free, see the "download" link in the Eclipse section of the CS 302 menu). As you do the tutorial make sure to give your partner a chance to try things out. Make sure to go through the CS 302 tutorial about Eclipse rather than the tutorial that comes with Eclipse.

When you are finished, inform your Lab TA, and then continue with the tasks below. Here's the link to the CS 302 Eclipse tutorial. It will open a new tab in your web browser. Click back on this tab to finish the lab after the tutorial.


Task 3: CS 302 Forms Page

We use a variety of web-based forms in CS 302. For programming assignments, there are forms for registering partnerships, submitting your work, and viewing your grade report (more later). There is also a form page for notifying us of any conflicts with the CS 302 exams, which is explained below.


A. Notify us if you have Exam Conflicts

If you have any conflicts with the CS 302 exam dates/times or accomodation requests, you must notify us by using the forms page (email is ignored). Click on the "Forms Page" in the "Resources" section of the CS 302 menu and login using your CS username and password. Both are case-sensitive. (If you've recently added CS 302 you might not have access yet. Try again later this week.) From the menu choose "Exam Conflicts" under the "Miscellaneous" menu item. Follow the instructions to report your exam conflict(s). You must submit all exam conflicts and accomodation requests by Friday of the 3rd week of classes (Friday of next week).

B. Handin your FortuneTeller.java file that was created as part of the Eclipse tutorial.

In general, lab work will not be handed in electronically.  For Lab 1, we wish for students to learn how to hand in program files.  Thus, a handin folder has been created so that all students may hand in their FortuneTeller.java program file.  Only source code files are handed in, and the files must be named exactly as directed in the assignments (or labs).  The handin program will not accept files that are named incorrectly.  Students must be logged into Forms and choose "Submit Files" from the appropriate assignment links. Carefully read and follow all online instructions.  Both lab partners must hand in the FortuneTeller.java file individually. Email a copy of the FortuneTeller.java file to your lab partner so they may save the file in their account and submit the file to check their handin directory.  Or, share on a usb flash drive.  (The tutorial can be repeated and the file submitted after lab, if necessary).

C. Use the List Files option on Forms to download an archive (zip) copy of the files in your handin directoy.  This is the best way to ensure that nothing is lost as you can use this as your backup in case you accidently copy over a file you intended to use.

D. Exiting the CS 302 Forms Page

To exit the CS 302 Forms Page click on "logout" at the top of the form but also close your browser to fully exit.


Task 4: Sharing your lab files with your lab partner

Let's assume Deb's lab partner is Jim, and that Deb is currently logged in to the CS lab computer and Jim is not. Since Deb is logged in, all lab files that Deb and Jim create will be under her account. If Jim wants a copy of those lab files they could do one of the following:

OK, but how does Jim run a program that he made with Deb? He should follow these steps:


Task 5: Challenges

  1. Modify HelloWorld to prompt the user for their name and then print a message to them.
  2. Write a program that reads in three numbers and computes their average.
  3. Write a program that reads in the radius and height of a cone and then prints the volume and surface area of the cone.
  4. Submit your HelloWorld.java file to your handin folder.  If you have already submitted a HelloWorld.java file, it will be overwritten when a new one is submitted. 

Wrap Up

If you made it here, then you're probably finished with lab 1! Note, most labs will take the entire lab time, but we expect that some will finish this lab early. Show your Lab TA the source code for your fortune teller program and also run the program before leaving.

Congratulations for finishing CS 302 Lab 1!