@@ -17,7 +17,7 @@ continues to work.
17
17
18
18
This philosophy, however, is not the one you want to employ when you
19
19
have (atypical for Elixir) programs that ask for user input.
20
- You want to those to crash infrequently and catch as many input errors as possible.
20
+ You want those to crash infrequently and catch as many input errors as possible.
21
21
22
22
In this étude, you will write a module named +ask_area+ , which prompts you
23
23
for a shape and its dimensions, and then returns the area by calling
@@ -74,7 +74,7 @@ program work.
74
74
Given a string as a prompt, displays the string
75
75
+"Enter _prompt_ > "+ and returns the number that was input.
76
76
This involves the following steps:
77
-
77
+
78
78
* Use +String.strip/1+ to get rid of the trailing newline character
79
79
* Use +string_to_integer/1+ to convert the string to a number.
80
80
@@ -129,7 +129,7 @@ The function you will use is the +Regex.match?/2+. It takes a regular expression
129
129
130
130
// [source,iex]
131
131
----
132
- iex(1)> Regex.match?(~r/e/, "hello")
132
+ iex(1)> Regex.match?(~r/e/, "hello")
133
133
true
134
134
iex(2)> Regex.match?(~r/[0-9]/, "h3llo")
135
135
true
@@ -160,11 +160,10 @@ iex(2)> Dates.date_parts("2013-06-15")
160
160
161
161
Use the +String.split/3+ function to accomplish this task.
162
162
How, you may ask, does that function work? Ask Elixir!
163
- In IEx, type +h String.split+ and you will see the online documentation for
163
+ In IEx, type +h String.split+ and you will see the online documentation for
164
164
that function.
165
165
166
166
Yes, I know this étude seems pointless, but trust me:
167
167
I'm going somewhere with this. Stay tuned.
168
168
169
169
<<SOLUTION05-ET03,See a suggested solution in Appendix A.>>
170
-
0 commit comments