Cliccando http://macosa.dima.unige.it/js/js.htm accedi ad un documento che ti spiega come eseguire direttamente (senza installare nulla né richiamare nulla da rete) programmi. Completa il seguente programma in modo da ottenere:
Abitanti dai 65 in su ogni 1000 ab. dai 15 in su in USA, Europa, Cina, India Dati del 2020 e previsioni ONU per il 2035 2020 2035 201 258 USA 228 285 Europa 154 253 Cina 90 128 India
<pre><script> with(Math) { // U, E, C, I: Usa, Europam Cina, India // 1,2 ab. 15-64 anni nel 2020,2035, 3,4 ab. 65+ anni nel 2020,2035 U1=219; U2=224; U3=55; U4=78 E1=485; E2=451; E3=143; E4=180 C1=989; C2=931; C3=180; C4=315 I1=939; I2=1079; I3=93; I4=159 document.writeln("Abitanti dai 65 in su ogni 1000 ab. dai 15 in su in USA, Europa, Cina, India") document.writeln("Dati del 2020 e previsioni ONU per il 2035") document.writeln("2020 2035") // ... } </script></pre>
Ecco:
<pre><script> with(Math) { // U, E, C, I: Usa, Europam Cina, India // 1,2 ab. 15-64 anni nel 2020,2035, 3,4 ab. 65+ anni nel 2020,2035 U1=219; U2=224; U3=55; U4=78 E1=485; E2=451; E3=143; E4=180 C1=989; C2=931; C3=180; C4=315 I1=939; I2=1079; I3=93; I4=159 document.writeln("Abitanti dai 65 in su ogni 1000 ab. dai 15 in su in USA, Europa, Cina, India") document.writeln("Dati del 2020 e previsioni ONU per il 2035") document.writeln("2020 2035") document.writeln(round(U3/(U1+U3)*1000)," ", round(U4/(U2+U4)*1000), " USA" ) document.writeln(round(E3/(E1+E3)*1000)," ", round(E4/(E2+E4)*1000), " Europa" ) document.writeln(round(C3/(C1+C3)*1000)," ", round(C4/(C2+C4)*1000), " Cina") document.writeln(" ",round(I3/(I1+I3)*1000)," ", round(I4/(I2+I4)*1000), " India" ) } </script></pre>