forked from paulruvolo/SoftwareDesign
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsoftdeshw2.txt
More file actions
72 lines (51 loc) · 3.42 KB
/
softdeshw2.txt
File metadata and controls
72 lines (51 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Kevin suzuki
worked with maor bernstein
What to turn in: You should write answers to the reading questions below and be prepared to show them to a NINJA. [optional] For part 3-3 you will send a pull request to Allen and I on GitHub. For Part Four you will turn your code in using GitHub.
Part One: Linux
a) What does grep do?
Grep searches a file for a certain word or phrase
b) What's the difference between a pipe and a redirect?
Redirect copies you output and puts it in a new file
Pipe takes an output of a command as an input of another command
c) What's so great about plain text?
It can be read by almost any application
d) If you rm a file by accident, how do you get it back?
You cannot
Part Two: Python
2) Read Chapter 2 of Think Python and answer the following questions:
a) In script mode, what happens if you put an expression, like math.sin(math.pi) on a line all by itself (without a print statement)?
It will solve it but not print the answer
b) What is the value of the expression 1.0 / 2.0 * math.pi? What about 1 / 2 * math.pi?
1.5707963267948966 and 0 respectively
c) Do Exercise 2.4 (Practice using Python as a calculator). For part 3, consider using Unum.
1) 523.5987755982989 2) $945.45 3) 7:30:10 am
Part Three: Git
3) Optional: Read Chapter 2 of Am Git and do what it tells you to do. (Note: this exercise will have you contributing to a collaborative writing project that Allen created called the Blair Walden Project.)
When you are done, you should have an account on GitHub, you should have forked and cloned a repo, and you should have sent me a pull request (and you will know what all that means).
4) Read Chapter 3 of Am Git and answer these questions:
a) What is an "untracked" file?
An untracked file is one that is in the project folder but you have never told Git to keep track of it
b) Why are files containing object code and executables generally not tracked?
You never want to track files generated by compilers and other programs because you should only include files that someone else would need to clone your repo and rebuild the project.
c) In Git vocabulary, what is a remote?
Remote means a project that is not under a local repository
5) Start your repo for this class.
On Github, find and fork PaulRuvolo/SoftwareDesign
Clone a local copy
Fill in hw2/grid.py with your solution to exercise 3.5 (see part 4). Don't forget to add your name as author.
Fill in hw2/fermat.py with your solution to exercise 5.3 (see part 4)
Fill in hw2/compare.py with your solution to exercise 6.1 (see part 4)
Push the commit to your repo. Then follow the directions below to add me as a collaborator:
https://help.github.com/articles/how-do-i-add-a-collaborator
Part Four: More Python!
6) Read Chapter 3 of Think Python and answer the following questions:
a) What's the difference between a fruitful function and a void function?
Fruitful functions return a value and void functions do not.
b) What are functions good for anyway?
Functions are good for creating a name for a group of statements, avoiding repetitive code, divide and conquer complicated code and to reuse them for other programs
c) What are the two forms of the import statement?
From module import operation
import module
7) Do Exercise 3-5 (grid drawing program)
8) Do Exercise 5-3 (Fermat's last theorem)
9) Do Exercise 6-1 (compare function)