Sale!

CS246—Assignment 0

$30.00

Category:
Rate this product

CS246—Assignment 0

This assignment is designed to get you familiar with the most basic aspects of working with
Linux, and with assignment submission. It is not worth any marks, but you must get 100%
on this assignment to get credit for the other assignments.
1. Read the course outline at
https://www.student.cs.uwaterloo.ca/~cs246/current/S18_CS246_Outline.html
2. Log into your linux.student.cs account and execute the command ls. You should see a
directory entitled cs246. If you do not see this directory, create it via the command mkdir
cs246.
3. Navigate to your cs246 directory: cd cs246.
4. Verify that you are in your cs246 directory: pwd.
5. Check out the course GIT repository:
git clone ssh://linux.student.cs.uwaterloo.ca/u/cs246/pubrepo/1185/.git
6. Verify that the checkout succeeded: ls. You should see a directory called 1185.
(Parenthetical note: 1185 is Quest-speak for Spring 2018. The last digit is the month, and
the first three digits, added to 1900, give the year.)
7. Navigate to the repository’s assignment 0 directory: cd 1185/assignments/a0.
8. Once again, verify that you are in the correct directory: pwd.
9. Read the manual page for the wc command: man wc.
10. Using a text editor (either vi or emacs), create the file hello.txt, with contents exactly as
shown below:
Hello from Linux!
I used vi.
If you used Emacs, replace vi above with emacs. You should press enter at the end of the first
line, and at the end of the second line. Once you have created the file, use the wc command
to determine how many lines the file contains. Take note of the relationship between the
number of times you pressed Enter, and the number of lines contained in the file. The exact
result will depend on your editor.
11. Navigate to your home directory: cd (or cd ~).
12. List the hidden files in your home directory: ls -d .*.
13. Determine whether your home directory contains a file called .bash_profile — if it doesn’t,
cp .profile .bash_profile; if it does, move on to the next step.
14. Using a text editor (either vi or emacs), open the file ~/.bash_profile (vi ~/.bash_profile
or emacs ~/.bash_profile). This file should not be empty; if it is, check that you have typed
the name of the file correctly. Add the following lines to the end of this file:
source ~cs246/setup
alias g++14=”g++ -std=c++14 -Wall -g”
(Optional) We recommend also adding the following lines to the end of this file:
alias vi=”vi -X”
export EDITOR=vi
If you choose to use vi, these lines will make vi launch faster, and will ensure that other tools
(like git) default to vi when they launch a text editor. If you choose to use emacs, omit the
first line, and replace vi with emacs in the second line. Save your changes and exit (in vi, hit
Escape and type :wq, followed by Enter; in emacs, Ctrl-X, Ctrl-S, Ctrl-X, Ctrl-C).
15. Navigate to your a0 directory: cd cs246/1185/assignments/a0.
16. Using a text editor (either vi or emacs), create the text file path1.txt that contains the answer
to the following question: if your current directory is /u/jdoe/cs246/1185, what relative path
is equivalent to the absolute path /u/jdoe/cs246/1185/lectures/c++/overload? Make
sure, as always, that your file ends with a newline character (whether this implies that you
must press Enter will depend on your editor). Use wc to verify for yourself that your file
consists of exactly one line.
17. Using a text editor (either vi or emacs), create the text file path2.txt that contains the
answer to the following question: if your current directory is /u/jdoe/cs246/1185, what
relative path is equivalent to the absolute path /u/jdoe/cs245/a1? Make sure, as always,
that your file ends with a newline character. Use wc to verify for yourself that your file consists
of exactly one line.
18. Use wc to count the number of words in your file hello.txt, and use output redirection to
store the result in the file hellowords.txt.
19. Create a text file called promise.txt that contains the following text, all on one line:
I promise not to publicly ask for or provide hints about Marmoset test cases
or assignment solutions on Piazza.
20. Make a zip file containing all of the files in your a0 directory: zip a0.zip * — make sure
you are in your cs246/1185/assignments/a0 directory when you do this.
21. Read these documents about submitting assignments to Marmoset:
http://www.student.cs.uwaterloo.ca/~cs241/w3m
http://www.student.cs.uwaterloo.ca/~cs246/current/marm_sub/index.html
22. Submit the file a0.zip to Marmoset.

Open chat
Need help?
Hello
Can we help you?