Ajout Ex1 - Question 1
This commit is contained in:
parent
0c8f15f1cf
commit
5f5a41ff00
16
README.md
16
README.md
@ -1 +1,17 @@
|
|||||||
# SAÉ S2.04 (visualisation de données)
|
# SAÉ S2.04 (visualisation de données)
|
||||||
|
|
||||||
|
## Exercice 1
|
||||||
|
### Question 1
|
||||||
|
> Calculer la surface terrestre mondiale, le nombre d’habitants mondial et la densité moyenne d’habitants au km2.
|
||||||
|
|
||||||
|
[Script Scilab](resources/scripts/ex1-1.sce) :
|
||||||
|
```scilab
|
||||||
|
data = csvRead("resources/data/data.csv");
|
||||||
|
surface = sum(data(:, 2)*1000);
|
||||||
|
population = sum(data(:, 3)*1000000);
|
||||||
|
densite = population / surface;
|
||||||
|
```
|
||||||
|
Résultat :
|
||||||
|
- Surface terrestre mondiale : 133 950 670 km2
|
||||||
|
- Nombre d'habitants mondial : 7 534 720 000 habitants
|
||||||
|
- Densité moyenne : 56,25 habitants/km²
|
||||||
|
7
resources/scripts/ex1-1.sce
Normal file
7
resources/scripts/ex1-1.sce
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
data = csvRead("resources/data/data.csv");
|
||||||
|
surface = sum(data(:, 2)*1000);
|
||||||
|
population = sum(data(:, 3)*1000000);
|
||||||
|
densite = population / surface;
|
||||||
|
mprintf("Surface terrestre mondiale : %d km²\n", surface);
|
||||||
|
mprintf("Nombre d''habitants mondial : %.0f habitants\n", population);
|
||||||
|
mprintf("Densité moyenne : %.0f habitants/km²\n", densite);
|
Loading…
Reference in New Issue
Block a user