|
|
|
|
201
|
|
201
|
|
202
|
* **3 Sorts:** a function that receives three strings and orders them in lexicographic (alphabetical) order. For example, given `giraffe`, `fox`, and `coqui`, it would order them as: `coqui`, `fox`, and `giraffe`. To simplify the exercise, we will be using strings with lowercase **letters**. Figure 5 shows the function's interface. Notice there is a menu to select the implemented version.
|
202
|
* **3 Sorts:** a function that receives three strings and orders them in lexicographic (alphabetical) order. For example, given `giraffe`, `fox`, and `coqui`, it would order them as: `coqui`, `fox`, and `giraffe`. To simplify the exercise, we will be using strings with lowercase **letters**. Figure 5 shows the function's interface. Notice there is a menu to select the implemented version.
|
203
|
|
203
|
|
204
|
- ---
|
|
|
|
|
204
|
+ ---
|
205
|
|
205
|
|
206
|
![figure5.png](images/figure5.png)
|
206
|
![figure5.png](images/figure5.png)
|
207
|
|
207
|
|
208
|
**Figure 5** - Interface for the `3 Sorts` function.
|
208
|
**Figure 5** - Interface for the `3 Sorts` function.
|
209
|
|
209
|
|
210
|
- ---
|
|
|
|
|
210
|
+ ---
|
211
|
|
211
|
|
212
|
|
212
|
|
213
|
* **Dice:** when the user presses the `Roll them!` button, the program generates two random integers between 1 and 6. The program informs the sum of the two random integers.
|
213
|
* **Dice:** when the user presses the `Roll them!` button, the program generates two random integers between 1 and 6. The program informs the sum of the two random integers.
|
214
|
|
214
|
|
215
|
- ---
|
|
|
|
|
215
|
+ ---
|
216
|
|
216
|
|
217
|
![figure6.png](images/figure6.png)
|
217
|
![figure6.png](images/figure6.png)
|
218
|
|
218
|
|
219
|
**Figure 6** - Interface for the `Dice` function.
|
219
|
**Figure 6** - Interface for the `Dice` function.
|
220
|
|
220
|
|
221
|
- ---
|
|
|
|
|
221
|
+ ---
|
222
|
|
222
|
|
223
|
|
223
|
|
224
|
* **Rock, Paper, Scissors:** each one of the players enters their play and the program informs who the winner is. Figure 7 shows the options where one object beats the other. The game's interface is shown in Figure 8.
|
224
|
* **Rock, Paper, Scissors:** each one of the players enters their play and the program informs who the winner is. Figure 7 shows the options where one object beats the other. The game's interface is shown in Figure 8.
|
225
|
|
225
|
|
226
|
- ---
|
|
|
|
|
226
|
+ ---
|
227
|
|
227
|
|
228
|
![figure7.jpg](images/figure7.jpg)
|
228
|
![figure7.jpg](images/figure7.jpg)
|
229
|
|
229
|
|
230
|
**Figure 7** - Ways to win in "Rock, paper, scissors".
|
230
|
**Figure 7** - Ways to win in "Rock, paper, scissors".
|
231
|
|
231
|
|
232
|
- ---
|
|
|
|
|
232
|
+ ---
|
233
|
|
233
|
|
234
|
![figure8.png](images/figure8.png)
|
234
|
![figure8.png](images/figure8.png)
|
235
|
|
235
|
|
236
|
**Figure 8** - Interface for the `Rock, Paper, Scissors` function.
|
236
|
**Figure 8** - Interface for the `Rock, Paper, Scissors` function.
|
237
|
|
237
|
|
238
|
- ---
|
|
|
|
|
238
|
+ ---
|
239
|
|
239
|
|
240
|
|
240
|
|
241
|
* **Zulu time:** Given a time in Zulu format (time at the Greenwich Meridian) and the military zone in which the user wants to know the time, the program shows the time in that zone. The format for the entry data is in the 24 hour format `####`, for example `2212` would be 10:12pm. The list of valid military zones can be found in http://en.wikipedia.org/wiki/List_of_military_time_zones. The following are examples of some valid results:
|
241
|
* **Zulu time:** Given a time in Zulu format (time at the Greenwich Meridian) and the military zone in which the user wants to know the time, the program shows the time in that zone. The format for the entry data is in the 24 hour format `####`, for example `2212` would be 10:12pm. The list of valid military zones can be found in http://en.wikipedia.org/wiki/List_of_military_time_zones. The following are examples of some valid results:
|
|
|
|
|
244
|
* Given Zulu time 1230 and zone N (UTC-1), the result should be 1130.
|
244
|
* Given Zulu time 1230 and zone N (UTC-1), the result should be 1130.
|
245
|
* Puerto Rico is in military zone Q (UTC-4), therefore, when its 1800 in Zulu time, it's 1400 in Puerto Rico.
|
245
|
* Puerto Rico is in military zone Q (UTC-4), therefore, when its 1800 in Zulu time, it's 1400 in Puerto Rico.
|
246
|
|
246
|
|
247
|
- ---
|
|
|
|
|
247
|
+ ---
|
248
|
|
248
|
|
249
|
![figure9.png](images/figure9.png)
|
249
|
![figure9.png](images/figure9.png)
|
250
|
|
250
|
|
251
|
**Figure 9** - Interface for the `Zulu time` function.
|
251
|
**Figure 9** - Interface for the `Zulu time` function.
|
252
|
|
252
|
|
253
|
- ---
|
|
|
|
|
253
|
+ ---
|
254
|
|
254
|
|
255
|
|
255
|
|
256
|
####Instructions
|
256
|
####Instructions
|