CS 115 Lab 2, Part A: Setup and Practice
[Back to lab instructions]
Setup
- Before you start writing code, you will set up a directory for this assignment
on the cwolf server. To connect to cwolf, do one of the following:
- Enter your CS 115 subdirectory by typing
cd cs115
- Type pwd (print working directory) and verify that the output is:
/home/student/yourusername/cs115
- Create a directory for Lab 2 by typing
mkdir lab02
- Enter your Lab 2 directory by typing
cd lab02
- Type pwd again, and verify that the output is:
/home/student/yourusername/cs115/lab02
- For the next part of this lab, you will create, edit, and test Python programs. You have two choices:
- [local] You can use IDLE to create and edit your Python programs on your local computer.
At the end of the lab, you will use FileZilla to copy your files
to the cwolf server, and then you will use PuTTY or Terminal to log in to cwolf and test and submit your code.
- [remote] You can work directly on the cwolf server by typing text commands into PuTTY or Terminal.
You will use emacs to edit your Python programs and python3 to run them.
This lab will give directions for both options. Directions that only apply to a particular option will be marked with [local]
or [remote]. Make your choice now.
Practice
Before you proceed, answer a few questions in your writeup to
get more familiar with the Moodle math operators. These
questions emphasize the division and remainder operators,
which are tricky for many new programmers.
- Question 1 goes over the new vocabulary from lecture.
- Question 2 goes into more depth about division and remainders.
- Question 3 asks you to think about remainders some more.
- Question 4 highlights a useful application of division and/or remainders.
Be sure to ask for help if you need it. In this class, small misunderstandings
have a way of coming back to haunt you.
Once you have answered and understood these questions, continue to Part B.