October 2014
Intermediate to advanced
280 pages
7h 20m
English
Write a function to capitalize the sentences in a string. Each sentence is terminated by a period and a space. Right now, the case of the characters in the string is random.
| | iex> capitalize_sentences("oh. a DOG. woof. ") |
| | "Oh. A dog. Woof. " |
Chapter 7, Lists and Recursion, had an exercise about calculating sales tax. We now have the sales information in a file of comma-separated id, ship_to, and amount values. The file looks like this:
| | id,ship_to,net_amount |
| | 123,:NC,100.00 |
| | 124,:OK,35.50 |
| | 125,:TX,24.00 |
| | 126,:TX,44.80 |
| | 127,:NC,25.00 |
| | 128,:MA,10.00 |
| | 129,:CA,102.00 |
| | 120,:NC,50.00 |
Write a function that reads and parses this file and then passes the result to the sales_tax ...
Read now
Unlock full access