浏览代码

Update README.md

Git-Leon 7 年前
父节点
当前提交
3f7546ddbb
共有 1 个文件被更改,包括 158 次插入53 次删除
  1. 158
    53
      README.md

+ 158
- 53
README.md 查看文件

@@ -1,53 +1,158 @@
1
-# ZCW-MicroLabs-Loops
2
-
3
-##1) 1 to 10
4
-In the class **Numbers**, complete the method called **oneToTen()** so that it returns a string of the numbers 1 to 10. The Unit Test is provided for you.
5
-
6
-###Example<br>
7
-1: oneToTen()<br>
2: *** Output ***<br>
3: 1<br>
4: 2<br>
5: 3<br>
6: 4<br>
7: 5<br>
8: 6<br>
9: 7<br>
10: 8<br>
11: 9<br>
12: 10<br>
8
-
## 2) Odd Numbers
In the class **Numbers**, complete the method called **oddNumbers()** so that it returns a string of the positive odd numbers less than 20. The Unit Test is not provided for you, you must complete it.
9
-
10
-###Example<br>
11
-1: oddNumbers()<br>
2: *** Output *** <br>
3: 1<br>
4: 3<br>
5: 5<br>
6: 7<br>
7: 9<br>
8: 11<br>
9: 13<br>
10: 15<br>
11: 17<br>
12: 19<br>
12
-
## 3) Square Numbers
In the class **Numbers**, complete the method called **squares()** so that it returns a string of the square numbers up to 100. The Unit Test is not provided for you, you must complete it.
13
-
###Example<br>
14
-1: squares()<br>
2: *** Output *** <br>
3: 1<br>
4: 4<br>
5: 9<br>
6: 16<br>
7: 25<br>
8: 36<br>
9: 49<br>
10: 64<br>
11: 81<br>
12: 100<br>
15
-
## 4) Random Numbers
In the class **Numbers**, complete the method called **random4()** so that it returns a string of out four random integers between 1 and 10. The Unit Test is not provided for you, you must complete it.
16
-
17
-###Example<br>
18
-1: random4()<br>
2: *** Output *** <br>
3: 3<br>
4: 5<br>
5: 2<br>
6: 8<br>
19
-
## 5) Even Numbers < n

In the class **Numbers**, complete the method called **even()** so that it returns a string of the positive even numbers less than n. The Unit Test is not provided for you, you must complete it.

###Example<br>
20
-1: even(20)<br>
2: *** Output *** <br>
3: 2<br>
4: 4<br>
5: 6<br>
6: 8<br>
7: 10<br>
8: 12<br>
9: 14<br>
10: 16<br>
11: 18<br>
21
-
## 6) Powers of 2

In the class **Numbers**, complete the method called **powers()** so that it returns a string of out the powers of 2 from 2^1 up to to 2^n. The Unit Test is not provided for you, you must complete it.
22
-
23
-###Example<br>
24
-1: powers(8)<br>
2: *** Output *** <br>
3: 2<br>
4: 4<br>
5: 8<br>
6: 16<br>
7: 32<br>
8: 64<br>
9: 128<br>
10: 256<br>
25
-
## 7) Are we there yet?

In the class **CarRide**, complete the class so that it returns that outputs "Are we there yet?" and then waits for input. If the input is "Yes" the program ouputs "Good!" and exits, otherwite the program loops. The Unit Tests is not provided for you, you must complete it.
26
-
27
-###Example<br>
28
-1: "Are we there yet?"<br>
2: No<br>
3: "Are we there yet?"<br>
4: Spoons<br>
5: "Are we there yet?"<br>
6: Yes<br>
7: Good!<br>
29
-
## 8) Triangle

In the class **Shapes**, complete the method called **triangle()** so that it uses nested loops to produce the following pattern . The Unit Test is not provided for you, you must complete it.
30
-
31
-###Example<br>
1: triangle()<br>
2: *** Output *** <br>
3: * <br>
4: ** <br>
5: *** <br>
6: **** <br>
7: ***** <br>
32
-
## 9) Table Square

In the class **Shapes**, complete the method called **tableSquare()** so that it uses nested loops to produce a 4x4 table square. The Unit Test is not provided for you, you must complete it.
33
-
34
-###Example<br>
35
-tableSquare()<br>
*** Output *** <br>
A 4 x 4 table square<br>

36
- ```
37
- | 1 |  2 |  3 |  4 |
 | 2 |  4 |  6 |  8 |
38
- | 3 |  6 |  9 | 12 |
39
- | 4 |  8 | 12 | 16 |
40
- 
41
- ```
42
-
## 10) Table Squares

In the class **Shapes**, extend your answer to the last question produce a method that will return string of characters out og ***n x n*** table square. The Unit Test is not provided for you, you must complete it.
43
-
###Example<br>
44
- tableSquares(6)<br>
 *** Output *** <br>
 A 6 x 6 table square<br>
45
- 
46
- ```
47
- | 1 |  2 |  3 |  4 |  5 |  6 |
 | 2 |  4 |  6 |  8 | 10 | 12 |
48
- | 3 |  6 |  9 | 12 | 15 | 18 |
49
- | 4 |  8 | 12 | 16 | 20 | 24 |
50
- | 5 | 10 | 15 | 20 | 25 | 30 |
51
- | 6 | 12 | 18 | 24 | 30 | 36 |
52
- ```
53
- 
1
+# ZCW-MicroLabs-Loops
2
+
3
+## 1) 1 to 10
4
+In the class **Numbers**, complete the method called **oneToTen()** so that it returns a string of the numbers 1 to 10. The Unit Test is provided for you.
5
+
6
+### Example<br>
7
+1: oneToTen()<br>
8
+2: *** Output ***<br>
9
+3: 1<br>
10
+4: 2<br>
11
+5: 3<br>
12
+6: 4<br>
13
+7: 5<br>
14
+8: 6<br>
15
+9: 7<br>
16
+10: 8<br>
17
+11: 9<br>
18
+12: 10<br>
19
+
20
+## 2) Odd Numbers
21
+In the class **Numbers**, complete the method called **oddNumbers()** so that it returns a string of the positive odd numbers less than 20. The Unit Test is not provided for you, you must complete it.
22
+
23
+### Example<br>
24
+1: oddNumbers()<br>
25
+2: *** Output *** <br>
26
+3: 1<br>
27
+4: 3<br>
28
+5: 5<br>
29
+6: 7<br>
30
+7: 9<br>
31
+8: 11<br>
32
+9: 13<br>
33
+10: 15<br>
34
+11: 17<br>
35
+12: 19<br>
36
+
37
+## 3) Square Numbers
38
+In the class **Numbers**, complete the method called **squares()** so that it returns a string of the square numbers up to 100. The Unit Test is not provided for you, you must complete it.
39
+
40
+### Example<br>
41
+1: squares()<br>
42
+2: *** Output *** <br>
43
+3: 1<br>
44
+4: 4<br>
45
+5: 9<br>
46
+6: 16<br>
47
+7: 25<br>
48
+8: 36<br>
49
+9: 49<br>
50
+10: 64<br>
51
+11: 81<br>
52
+12: 100<br>
53
+
54
+## 4) Random Numbers
55
+In the class **Numbers**, complete the method called **random4()** so that it returns a string of out four random integers between 1 and 10. The Unit Test is not provided for you, you must complete it.
56
+
57
+### Example<br>
58
+1: random4()<br>
59
+2: *** Output *** <br>
60
+3: 3<br>
61
+4: 5<br>
62
+5: 2<br>
63
+6: 8<br>
64
+
65
+## 5) Even Numbers < n
66
+
67
+In the class **Numbers**, complete the method called **even()** so that it returns a string of the positive even numbers less than n. The Unit Test is not provided for you, you must complete it.
68
+
69
+### Example<br>
70
+1: even(20)<br>
71
+2: *** Output *** <br>
72
+3: 2<br>
73
+4: 4<br>
74
+5: 6<br>
75
+6: 8<br>
76
+7: 10<br>
77
+8: 12<br>
78
+9: 14<br>
79
+10: 16<br>
80
+11: 18<br>
81
+
82
+## 6) Powers of 2
83
+
84
+In the class **Numbers**, complete the method called **powers()** so that it returns a string of out the powers of 2 from 2^1 up to to 2^n. The Unit Test is not provided for you, you must complete it.
85
+
86
+### Example<br>
87
+1: powers(8)<br>
88
+2: *** Output *** <br>
89
+3: 2<br>
90
+4: 4<br>
91
+5: 8<br>
92
+6: 16<br>
93
+7: 32<br>
94
+8: 64<br>
95
+9: 128<br>
96
+10: 256<br>
97
+
98
+## 7) Are we there yet?
99
+
100
+In the class **CarRide**, complete the class so that it returns that outputs "Are we there yet?" and then waits for input. If the input is "Yes" the program ouputs "Good!" and exits, otherwite the program loops. The Unit Tests is not provided for you, you must complete it.
101
+
102
+### Example<br>
103
+1: "Are we there yet?"<br>
104
+2: No<br>
105
+3: "Are we there yet?"<br>
106
+4: Spoons<br>
107
+5: "Are we there yet?"<br>
108
+6: Yes<br>
109
+7: Good!<br>
110
+
111
+## 8) Triangle
112
+
113
+In the class **Shapes**, complete the method called **triangle()** so that it uses nested loops to produce the following pattern . The Unit Test is not provided for you, you must complete it.
114
+
115
+### Example<br>
116
+1: triangle()<br>
117
+2: *** Output *** <br>
118
+3: * <br>
119
+4: ** <br>
120
+5: *** <br>
121
+6: **** <br>
122
+7: ***** <br>
123
+
124
+## 9) Table Square
125
+
126
+In the class **Shapes**, complete the method called **tableSquare()** so that it uses nested loops to produce a 4x4 table square. The Unit Test is not provided for you, you must complete it.
127
+
128
+### Example<br>
129
+tableSquare()<br>
130
+*** Output *** <br>
131
+A 4 x 4 table square<br>
132
+
133
+ ```
134
+ | 1 |  2 |  3 |  4 |
135
+ | 2 |  4 |  6 |  8 |
136
+ | 3 |  6 |  9 | 12 |
137
+ | 4 |  8 | 12 | 16 |
138
+ 
139
+ ```
140
+
141
+## 10) Table Squares
142
+
143
+In the class **Shapes**, extend your answer to the last question produce a method that will return string of characters out og ***n x n*** table square. The Unit Test is not provided for you, you must complete it.
144
+
145
+### Example<br>
146
+ tableSquares(6)<br>
147
+ *** Output *** <br>
148
+ A 6 x 6 table square<br>
149
+ 
150
+ ```
151
+ | 1 |  2 |  3 |  4 |  5 |  6 |
152
+ | 2 |  4 |  6 |  8 | 10 | 12 |
153
+ | 3 |  6 |  9 | 12 | 15 | 18 |
154
+ | 4 |  8 | 12 | 16 | 20 | 24 |
155
+ | 5 | 10 | 15 | 20 | 25 | 30 |
156
+ | 6 | 12 | 18 | 24 | 30 | 36 |
157
+ ```
158
+