|
|
|
|
294
|
##Laboratory Session:
|
294
|
##Laboratory Session:
|
295
|
|
295
|
|
296
|
|
296
|
|
297
|
-### Exercise 0 - Download and understand the code
|
|
|
|
|
297
|
+### Exercise 1 - Download and understand the code
|
298
|
|
298
|
|
299
|
|
299
|
|
300
|
####Instructions
|
300
|
####Instructions
|
|
|
|
|
332
|
2. `void drawPoints(GISPOI* gisLocations, unsigned int size);`: Given an array of `GISPOI` objects and their size, displays their locations as points in the map.
|
332
|
2. `void drawPoints(GISPOI* gisLocations, unsigned int size);`: Given an array of `GISPOI` objects and their size, displays their locations as points in the map.
|
333
|
|
333
|
|
334
|
|
334
|
|
335
|
-### Exercise 1 - Read the georeferenced points into an array
|
|
|
|
|
335
|
+### Exercise 2 - Read the georeferenced points into an array
|
336
|
|
336
|
|
337
|
|
337
|
|
338
|
Remember that you will only be changing code in the `main.cpp` file. Your first task will be to add code to read the entire contents of a file into an array of `GISPOI` objects.
|
338
|
Remember that you will only be changing code in the `main.cpp` file. Your first task will be to add code to read the entire contents of a file into an array of `GISPOI` objects.
|
|
|
|
|
374
|
|
374
|
|
375
|
|
375
|
|
376
|
|
376
|
|
377
|
-### Exercise 2 - Max and min functions
|
|
|
|
|
377
|
+### Exercise 3 - Max and min functions
|
378
|
|
378
|
|
379
|
|
379
|
|
380
|
Once you have the information of georeferenced cities in the array of objects, you can start processing them in many interesting ways. We will start with some basic operations.
|
380
|
Once you have the information of georeferenced cities in the array of objects, you can start processing them in many interesting ways. We will start with some basic operations.
|
|
|
|
|
396
|
|
396
|
|
397
|
|
397
|
|
398
|
|
398
|
|
399
|
-### Exercise 3 - Compute the cycle distance
|
|
|
|
|
399
|
+### Exercise 4 - Compute the cycle distance
|
400
|
|
400
|
|
401
|
|
401
|
|
402
|
1. Read the documentation and implement the function `double cycleDistance(GISPOI A[], int size, int P[])`. Invoke the function from `main()` as indicated in the comments inside the `main()` function:
|
402
|
1. Read the documentation and implement the function `double cycleDistance(GISPOI A[], int size, int P[])`. Invoke the function from `main()` as indicated in the comments inside the `main()` function:
|
|
|
|
|
406
|
|
406
|
|
407
|
|
407
|
|
408
|
|
408
|
|
409
|
-### Exercise 4 - More fun!
|
|
|
|
|
409
|
+### Exercise 5 - More fun!
|
410
|
|
410
|
|
411
|
|
411
|
|
412
|
1. Change your code so that it now opens the `pr.txt` file. Validate your results and marvel at your great achievement!
|
412
|
1. Change your code so that it now opens the `pr.txt` file. Validate your results and marvel at your great achievement!
|