2008 CS 121 First Lab Student Procedures

Total Page:16

File Type:pdf, Size:1020Kb

2008 CS 121 First Lab Student Procedures

2009-10 CS 121 First Lab Student Procedures

1. Log into the workstation using your GU provided username/password. a. If you do not know your username or password call x5550 for the helpdesk. b. If you receive a warning that your home directory does not exist, contact the lab administrator. 2. Launch putty.exe (on desktop) and login into ada using the same username/password. Ada is the CPSC computer located physically in the basement of College Hall. It’s DNS (network name) is ada.gonzaga.edu with an IP address of 147.222.165.3. 3. Type “submit” and hit the enter key. You will see a list of CPSC course along with a number in brackets. Type “4” (the number corresponding to CPSC-121-03) and hit enter. After some messages displayed you will be back at the $ prompt. 4. You should now have the following directory on ada /home/winnt/GONZAGA/yourname/documents/classwork/CPS-121-03 (in windows that is the same as: U:\documents\classwork\CPS-121-03). Verify this by changing your directory to that directory using the cd command. 5. Make sure your present working directory is: /home/winnt/GONZAGA/yourname/documents/classwork/CPS-121-03 by using the pwd (print working directory) command 6. Create a new directory called lab1dir using the mkdir command. 7. Change your working directory to lab1dir. (cd lab1dir) 8. On windows launch the python3.1 GUI Idle (desktop icon). This starts the python shell and you should see the python prompt “>>>”. 9. Try doing some basic math operations in the python environment. 3+4 , 6/4 , 6//4 . Note the difference answers.

10. Now we’ll create a file using the idle editor and save it to your working directory lab1 created above. 11. In the python shell window click on File->New Window. This opens an IDLE editor window. In this window type in the following: print(“Hello World”) 12. To save this file click File->, Save as -> and navigate to the lab1dir directory on ada and save the file as hello.py. To verify you have saved the file go to the putty window and show a listing of the files in lab1dir (ls). 13. To run the hello program from the idle editor window click on Run -> Run Module 14. Modify the file to print your name out. Save the file (file->save) and rerun (F5). 15. Lastly you will submit the hello.py program. On ada at the prompt type “submit”, then enter 4, then enter the number corresponding to the lab1dir directory and hit enter. You should get a message indicating lab1dir is submitted. 16. Logoff ada using “exit”.

Recommended publications