-
Notifications
You must be signed in to change notification settings - Fork 206
/
Copy pathcalculator.js
65 lines (45 loc) · 1017 Bytes
/
calculator.js
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
/**
* Declare a function named `calculatorModule`
* this function will have two private variables declared inside of it.
* @variable PRIVATE { Number } `memory`
* @variable PRIVATE { Number } `total`
* @return {object} `calculator` object that can be used
*/
/**
* sets the `total` to the number passed in
* @param { Number } x
* @return { Number } current total
*/
/**
* Return the value of `total`
* @return { Number }
*/
/**
* Sums the value passed in with `total`
* @param { Number } x
*/
/**
* Subtracts the value passed in from `total`
* @param { Number } x
*/
/**
* Multiplies the value by `total`
* @param { Number } x
*/
/**
* Divides the value passing in by `total`
* @param { Number } x
*/
/**
* Return the value stored at `memory`
* @return { Number }
*/
/**
* Stores the value of `total` to `memory`
*/
/**
* Clear the value stored at `memory`
*/
/**
* Validation
*/