Categories: trending

What number will Switzerland crack soon? Estimate the population of 20 European countries

Since the introduction of the free movement of persons in 2002, Switzerland has experienced rapid population growth. In the last 20 years or so, the population has increased by almost 20 percent – compared to our immediate neighbours, this is clearly the highest value.

Rapid population growth is also why Switzerland will cross the next million mark this year. Which one should you choose for yourself in the next guessing quiz? And while you're at it, also the population figures of 19 other European countries. But beware, it gets pretty tricky...

const questionList = [ ['Schweiz',8.74,'','https://www.watson.ch/imgdb/5806/Qx,E,0,0,0,0,0,0,0,0/2638810972235615', ''], ['Deutschland',84.08,'','https://www.watson.ch/imgdb/7fd2/Qx,E,0,0,0,0,0,0,0,0/5659786235354475', ''], ['Türkei',85.34,'','https://www.watson.ch/imgdb/a2a6/Qx,E,0,0,0,0,0,0,0,0/1233715763601504', ''], ['Österreich',8.94,'','https://www.watson.ch/imgdb/7f30/Qx,E,0,0,0,0,0,0,0,0/7833957712241198', ''], ['Spanien',47.56,'','https://www.watson.ch/imgdb/e7cb/Qx,E,0,0,0,0,0,0,0,0/1713054604526554', ''], ['Italien',59.04,'','https://www.watson.ch/imgdb/63d1/Qx,E,0,0,0,0,0,0,0,0/1750667369333279', ''], ['Kroatien',4.03,'','https://www.watson.ch/imgdb/53a3/Qx,E,0,0,0,0,0,0,0,0/5109271813058758', ''], ['Grossbritannien',67.51,'','https://www.watson.ch/imgdb/646d/Qx,E,0,0,0,0,0,0,0,0/2098371622722106', ''], ['Schweden',10.55,'','https://www.watson.ch/imgdb/7db8/Qx,E,0,0,0,0,0,0,0,0/6425164698039510', ''], ['Polen',40.02,'','https://www.watson.ch/imgdb/64dc/Qx,E,0,0,0,0,0,0,0,0/3440688630717294', ''], ['Niederlande',17.56,'','https://www.watson.ch/imgdb/57de/Qx,E,0,0,0,0,0,0,0,0/8978329907173381', ''], ['Serbien',7.22,'','https://www.watson.ch/imgdb/c871/Qx,E,0,0,0,0,0,0,0,0/6285041325121935', ''], ['Griechenland',10.38,'','https://www.watson.ch/imgdb/55ea/Qx,E,0,0,0,0,0,0,0,0/7777512430896339', ''], ['Finnland',5.54,'','https://www.watson.ch/imgdb/58f5/Qx,E,0,0,0,0,0,0,0,0/2221034613819154', ''], ['Portugal',10.27,'','https://www.watson.ch/imgdb/fcad/Qx,E,0,0,0,0,0,0,0,0/5651877790169356', ''], ['Estland',1.33,'','https://www.watson.ch/imgdb/e7a6/Qx,E,0,0,0,0,0,0,0,0/5862835648973865', ''], ['Frankreich',64.63,'','https://www.watson.ch/imgdb/cdae/Qx,E,0,0,0,0,0,0,0,0/7806451246210829', ''], ['Albanien',2.84,'','https://www.watson.ch/imgdb/48e6/Qx,E,0,0,0,0,0,0,0,0/1587350327292843', ''], ['Norwegen',5.43,'','https://www.watson.ch/imgdb/f8a5/Qx,E,0,0,0,0,0,0,0,0/2045041106024266', ''], ['Belgien',11.66,'','https://www.watson.ch/imgdb/5887/Qx,E,0,0,0,0,0,0,0,0/6090768592378952', ''], ];

const projectId = 35; // Add in this list: https://docs.google.com/spreadsheets/d/1jJDX-UIVlUcK0OET2zjrmfqeqcRe3WUF38Q3FSiBHns/edit?usp=sharing const unit=" Milionen"; // What unit are the values in? const min = 0; // Minimum value const max = 100; // Maximum value

const lessLabel = min.toString() + unit; // Labelling of the min value const moreLabel = max.toString() + unit; // Labelling of the max value

// make a function createQuestionContent that returns the content of the question function createQuestionContent(reviewQuestions) {

for (var idx = 0; idx < questionList.length; idx++) { var questionContent = "

" + questionList[idx][0] + "

" + questionList[idx][2] + "

" + questionList[idx][4] + "

Deine Schätzung: " + min + " " + unit + "

Schnitt watson-User: – " + unit + "

Tatsächliche Einwohner: – " + unit + "

"; questionContent += "

" + lessLabel + "" + moreLabel + "

"; reviewQuestions[idx].innerHTML = question content; } // Update value in text element var allSliders = document.getElementsByClassName('questionSlider'); Array.prototype.forEach.call(allSliders, function (slider) { // Loop over each element to .oninput function slider.oninput = function (event) { var idx = slider.getAttribute('idx'); // now update according to span document.getElementById('r' + idx + '-my').innerHTML = formatText(this.value);} }); return reviewQuestions; } const roundedStartMean = Math.round((min + max) / 2); for (var idx = 0; idx < poll.length; idx++) { poll[idx].push(roundedStartAverage); } image URLs = []; average URLs = []; for (var idx = 0; idx < questionList.length; idx++) { var id = questionList[idx][3].split("https://www.watson.ch/").pop(); var picutreUrl = "https://www.watson.ch/api/2.0/images/" + id; pictureUrls.push(picutreUrl); var key = "slider-quiz" + projectId.toString() + "-" + (idx + 1).toString(); var apiUrlWatsonMean = "https://www.watson.ch/api/2.0/key-values/" + key + "/histogram"; averageUrls.push(apiUrlWatsonMean); } Promise.all( pictureUrls.map(url =>
fetch(url).then(response => response.json()) .catch(error => console.error(error)) ) ).then(data => { // loop over data for (var idx = 0; idx < data.length; idx++) { var pictureCredit = "Bild: " + data[idx].data.credit; questionList[idx][4] = pictureCredit; } reviewQuestions = createQuestionContent(reviewQuestions) }) .catch(error => console.error(error)); Promise.all( averageUrls.map(url => fetch(url) .then(response => response.json()) .catch(error => console.error(error)) ) ) .then(data => { / / loop over data for (var idx = 0; idx < data.length; idx++) { const keys = Object.keys(data[idx].facts); const values ​​= Object.values(data[idx].facts); if (keys.length != 0) { // transform keys to numbers for (let i = 0; i < keys.length; i++) { keys[i] = parseInt(keys[i]); } let the sum = 0; for (let i = 0; i < keys.length; i++) { sum += keys[i] * values[i]; } average = sum / values.reduce((acc, curr) => acc + current, 0); average = Math.round(average); questionList[idx][5] = mean; reviewQuestions = createQuestionContent(reviewQuestions) } } }).catch(error => console.error(error)); var reviewQuestions = document.getElementsByClassName('reviewQuestion'); if (reviewQuestions.length != questionList.length) { console.log("questionList must be the same length as the number of divs (list: " + questionList.length + ", divs: " + reviewQuestions.length + ")!") } function formatText(text) { if (text % 1 === 0) { return text.toString(); } else { return text.toFixed(2).toString(); } } reviewQuestions = createQuestionContent(reviewQuestions) function sendData(questionId, noReview = false) { let dataToSend = { 'questionId': questionId, 'version': 0.9, 'projectId': projectId }; if (noReview) { // just get the average dataToSend['userInput'] = zero; document.querySelector("#r" + questionId + "-my").innerHTML = "-"; document.querySelector("#s" + questionId + "-slider").classList.add('rangeOut'); } else { // send my review let valSlider = document.querySelector("#s" + questionId + "-slider").value; dataToSend['userInput'] = parseFloat(valSlider); const key = "slider quiz" + projectId.toString() + "-" + (questionId + 1).toString(); const jwt_token = localStorage.getItem("jwt_token"); const jwt_free_token = localStorage.getItem("jwt_free_token"); const user_id = localStorage.getItem("user_id"); let value as (user_id) { value = { user: user_id, value: dataToSend['userInput']
}; } else { value = { user: jwt_free_token, value: dataToSend['userInput']
}; } let options = { method: 'post', body: JSON.stringify(dataToSend) }; fetch(`https://www.watson.ch/api/2.0/key-values/${key}`, { method: "POST", headers: { "Content-Type": "application/json", " Authorization": `Bearer ${jwt_free_token}` }, body: JSON.stringify(value) }) .then(response => response.json()).catch(error => console.error(error)); } document.querySelector("#r" + questionId + "-wtsn").innerHTML = formatText(questionList[
questionId][5]); document.querySelector("#r" + questionId + "-co2").innerHTML = formatText(questionList[
questionId][1]); document.querySelector("#wtsnMean-" + questionId).style.display = 'inline'; document.querySelector("#wtsnMean-" + questionId).style.left = (0.88 * ((questionList[questionId][5] - min) * 100 / (max - min)) + 5) + "%"; document.querySelector("#wtsnMean-" + questionId).style.display = 'inline'; document.querySelector("#co2-" + questionId).style.left = (0.88 * ((questionList[questionId][1] - min) * 100 / (max - min)) + 5) + "%" document.querySelector("#co2-" + questionId).style.display = 'inline'; document.querySelector("#btnRate-" + questionId).disabled = true; document.querySelector("#btnView-" + questionId).disabled = true; document.querySelector("#s" + questionId + "-slider").disabled = true; }

Phillip Reich

Source: Blick

Share
Published by
Ross

Recent Posts

Terror suspect Chechen ‘hanged himself’ in Russian custody Egyptian President al-Sisi has been sworn in for a third term

On the same day of the terrorist attack on the Krokus City Hall in Moscow,…

1 year ago

Locals demand tourist tax for Tenerife: “Like a cancer consuming the island”

class="sc-cffd1e67-0 iQNQmc">1/4Residents of Tenerife have had enough of noisy and dirty tourists.It's too loud, the…

1 year ago

Agreement reached: this is how much Tuchel will receive for his departure from Bayern

class="sc-cffd1e67-0 iQNQmc">1/7Packing his things in Munich in the summer: Thomas Tuchel.After just over a year,…

1 year ago

Worst earthquake in 25 years in Taiwan +++ Number of deaths increased Is Russia running out of tanks? Now ‘Chinese coffins’ are used

At least seven people have been killed and 57 injured in severe earthquakes in the…

1 year ago

Now the moon should also have its own time (and its own clocks). These 11 photos and videos show just how intense the Taiwan earthquake was

The American space agency NASA would establish a uniform lunar time on behalf of the…

1 year ago

This is how the Swiss experienced the earthquake in Taiwan: “I saw a crack in the wall”

class="sc-cffd1e67-0 iQNQmc">1/8Bode Obwegeser was surprised by the earthquake while he was sleeping. “It was a…

1 year ago