CS2 Lab 0 2024, Getting
Started 🎰
<<< Back to
main site
Due Date: 2024/9/19
Complete this lab before Lab 1.
Need help? Remember to check out Edstem and our Website for TA help
assistance.
Background 🎰
Be sure to read all background notes, as they are vital to do the assignment.
Welcome to CS2! We're so glad you've decided to join us on this journey through the Digital
World.
Computer Scientists and Programmers alike manage many files
on their computers, and it's important to have proper organization! Let's review the basic structures of
a computer:
- A file is the smallest component. It is a container in
a computer system for storing information. It can be a file of text, of code, or even images. All
files have a tag at the end of their name, such as .png,
.txt, .doc, etc.
- A folder is like the bucket that holds groups of files.
These can contain files and even other folders. Unlike files, they do not have a tag at the
end.
Important Note: In CS2 we will refer to a folder as a
"directory". Directories are the more common nomenclature
that computer scientists use.
Directories and files are often written out in text, like so:
~/mycomputer/desktop/cs2/gettingstarted.txt
Think about what this might represent… Let's break it
down. Every /
character (\
on windows) represents a
sub-directory (a folder!). So, we are looking at a text file called "gettingstarted" in the
cs2
directory. The cs2
directory is in the
desktop
directory, which is on our computer drive!
This written out representation of a file's place on a computer is called a
file path.
The last thing to know for this class when it comes to directories is absolute
file path vs relative file
paths.
Say we are editing a file called javascript.txt
in a folder
cs2
that contains one other file, called
my_image.png
.
In programming, files like to talk to each other. In this example,
javascript.txt
wants to know about my_image.png
. We can
tell javascript.txt
about my_image
two different
ways.
In the javascript.txt
file, we can put:
~/donstanford/desktop/cs2/my_image.png
or
/my_image.png
The first example is called an absolute file path, and it's
the exact representation of a file from the root
of my computer.
The second example is called a relative file path.
Important Note: In CS2 we
ONLY use relative file
paths.
There are two reasons why:
- All projects in CS2 must be anonymous. If we see your name in a file path, that anonymity is
gone, and we have to dock points!
- Absolute file paths won't work on the TA computers- think about it, will our computer be able
to find a file under a folder that only exists on your computer? (like, your name!).
You're ready for the next part of the lab! Great job :)
Project/Lab Description
🎰
It's time to set up your CS2 directory! Throughout this
course, you'll put everything into this directory, and keep a tidy organization. 🧽
This lab will handle most of the set up you will need for the rest of the course!
Tasks 🎰
To get started, you will need a text editor to write your
code throughout the semester. A text editor lets you easily edit and create files in different
programming languages.
Task 1 Download the text editor Visual Studio
Code. Follow all the instructions on the website to download the
editor for your specific machine.
Be sure to download "Visual Studio Code" not "Visual
Studio"!
Now we need to set up your file system for the course. Use the instructions for your particular
machine.
Task 2 Create the basic file structure on your computer, with a
folder called CS2
on your desktop, and a folder inside it named
Excel
.
Mac Instructions
- Right click your desktop. Click "New Folder"
from the dropdown. This should create the folder, and outline the name for editing.
- Name the folder "CS2", click
enter
on your keyboard.
- Double-click the newly created folder to
open it.
- Inside this new folder, right click anywhere
and click "New Folder" from the dropdown.
- Name this new sub-folder "Excel"
Windows Instructions
- Minimize your windows so you can see your
desktop.
- Right click your desktop and click "New"
-> "Folder"
- Rename this newly recreated folder "CS2" (it
should already be highlighted to edit, if not right click the folder). Click
enter
on the keyboard.
- Double click the newly created folder to
open it.
- Inside this new folder, right click anywhere
and click "New" -> "Folder" from the dropdown.
- Name this new sub-folder "Excel".
Hand-In 🎰
To Hand-In Lab 0:
Come to hours and show your TA three things for checkoff:
- Email verifying your completed the collaboration policy
- The downloaded Visual Studio Code.
- Your CS2 File System.
Congrats! You just finished your first CS2 lab!
CS2 Lab 0 2024, Getting Started 🎰
<<< Back to main site
Background 🎰
Welcome to CS2! We're so glad you've decided to join us on this journey through the Digital World.
Computer Scientists and Programmers alike manage many files on their computers, and it's important to have proper organization! Let's review the basic structures of a computer:
Important Note: In CS2 we will refer to a folder as a "directory". Directories are the more common nomenclature that computer scientists use.
Directories and files are often written out in text, like so:
Think about what this might represent… Let's break it down. Every
/
character (\
on windows) represents a sub-directory (a folder!). So, we are looking at a text file called "gettingstarted" in thecs2
directory. Thecs2
directory is in thedesktop
directory, which is on our computer drive!The last thing to know for this class when it comes to directories is absolute file path vs relative file paths.
Say we are editing a file called
javascript.txt
in a foldercs2
that contains one other file, calledmy_image.png
.In programming, files like to talk to each other. In this example,
javascript.txt
wants to know aboutmy_image.png
. We can telljavascript.txt
aboutmy_image
two different ways.In the
javascript.txt
file, we can put:or
The first example is called an absolute file path, and it's the exact representation of a file from the
root
of my computer.The second example is called a relative file path.
Important Note: In CS2 we ONLY use relative file paths.
There are two reasons why:
You're ready for the next part of the lab! Great job :)
Project/Lab Description 🎰
It's time to set up your CS2 directory! Throughout this course, you'll put everything into this directory, and keep a tidy organization. 🧽
This lab will handle most of the set up you will need for the rest of the course!
Tasks 🎰
Task 0: Before proceeding, please be sure to fill out our Course Collaboration Policy!
To get started, you will need a text editor to write your code throughout the semester. A text editor lets you easily edit and create files in different programming languages.
Task 1 Download the text editor Visual Studio Code. Follow all the instructions on the website to download the editor for your specific machine.
Now we need to set up your file system for the course. Use the instructions for your particular machine.
Task 2 Create the basic file structure on your computer, with a folder called
CS2
on your desktop, and a folder inside it namedExcel
.Mac Instructions
enter
on your keyboard.Windows Instructions
enter
on the keyboard.Hand-In 🎰
To Hand-In Lab 0:
Come to hours and show your TA three things for checkoff:
Congrats! You just finished your first CS2 lab!
If you have any issues with completing this assignment, please reach out to the course HTAs: cs0020headtas@lists.brown.edu
If you need to request an extension, contact Professor Stanford directly: don.stanford@gmail.com