You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-12Lines changed: 9 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,6 @@
1
1
# Assignment: functions
2
2
3
-
## How to clone this repo
4
-
5
-
Clone this repository by clicking the green button in the upper right corner, selecting `SSH` and copying the string that looks like `git@github.com:code4policy/<REPO-NAME>.git` (`<REPO-NAME>` will be the name of your repository). Then, in the terminal run the following:
10. Make sure everything works correctly and issue a pull request on github back to the main branch with a message explaining what changes you made in this branch.
54
46
55
47
11. Accept the pull request into the main branch and delete the `calculator` branch on github.
56
-
57
48
12. Checkout the main branch, and pull the version of main with the calculator branch merged
14. Add two more functions, `square` and `cube`. both should take a single number as an argument and return the number raised to the appropriate power.
61
+
14. Create a new branch from `main`. In the new branch, add two more functions, `square` and `cube`. both should take a single number as an argument and return the number raised to the appropriate power.
71
62
15. Make a function called `square_n_times` that takes two arguments, `number` and `n`. Have the function square the number `n` times and return the sum.
63
+
16. PR the new branch to `main`. Your `calcluator.py` in `main` should now have functions for addition, subtraction, multiplication, division, squaring, cubing, and adding squares `n` times.
72
64
73
65
## Javascript (ungraded)
74
66
75
-
1. create a new branch in your `assignments` git repo called "js-calculator"
67
+
### Install `node`
68
+
On WSL: `sudo apt-get install npm`
69
+
On Mac: `brew install npm`
70
+
71
+
### Tasks
72
+
1. create a new branch `js-calculator`
76
73
2. inside that branch create a new file called `calculator.js`
77
74
78
75
3. Write (in javascript) a program that defines four functions (multiply, add, subtract, and divide). These functions should not print anything, they should simply perform a mathematical operation on the two arguments and return the value.
0 commit comments