SAE_S2.04/Exo1/Question2.sce

31 lines
1.0 KiB
Scilab

data = csvRead("data/data.csv");
//Afrique
surfaceAfrique = sum(data(1:57, 2)* 1000);
populationAfrique = sum(data(1:57, 3)* 1000000);
densiteAfrique = populationAfrique / surfaceAfrique;
//Amérique du nord
surfaceAmeriqueNord = sum(data(58:86, 2)* 1000);
populationAmeriqueNord = sum(data(58:86, 3)* 1000000);
densiteAmeriqueNord = populationAmeriqueNord / surfaceAmeriqueNord;
//Amérique du sud
surfaceAmeriqueSud = sum(data(87:99, 2)* 1000);
populationAmeriqueSud = sum(data(87:99, 3)* 1000000);
densiteAmeriqueSud = populationAmeriqueSud / surfaceAmeriqueSud;
//Asie
surfaceAsie = sum(data(100:150, 2)* 1000);
populationAsie = sum(data(100:150, 3)* 1000000);
densiteAsie = populationAsie / surfaceAsie;
//Europe
surfaceEurope = sum(data(151:193, 2)* 1000);
populationEurope = sum(data(151:193, 3)* 1000000);
densiteEurope = populationEurope / surfaceEurope;
//Océanie
surfaceOceanie = sum(data(194:207, 2)* 1000);
populationOceanie = sum(data(194:207, 3)* 1000000);
densiteOceanie = populationOceanie / surfaceOceanie;