# [J-Script] Question 2

There is a small town with 50,000 people living in it. A person came to the town at 0800 with a news. Within 15 minutes, he managed to tell that news to 3 people. Assuming that each person will tell that news to another 3 personals and it takes 15 minutes to tell the news, calculate;

The number of people knows the new at 0915.

function VirusGuard(sectorzies,cleanrate,replicationrate) {
var result = ;
return result;
}

VirusGuard(810241024,5.1210241000,2.5);

Time: 8:15 people:4
Time: 8:30 people:16
Time: 8:45 people:64
Time: 9:00 people:256
Time: 9:15 people:1024
Time: 9:30 people:4096
Time: 9:45 people:16384
Time: 10:00 people:65536

Hear is a code:

``````var d = new Date(1, 1, 1, 8, 0, 0, 0);

var person = 1;

while(true){

d.setMinutes(d.getMinutes() + 15);

var newPerson=0;
for(var i =0; i<person; i++) {
newPerson+=3;
}
person+=newPerson;
var min = d.getMinutes().toString().length == 1 ? "0"+d.getMinutes() : d.getMinutes();
console.log("Time: "+d.getHours()+":"+min+" people:" +person);
// if(d.getHours()==9 && d.getMinutes()==15) {
//   break;
// }
if(person>50000) {
break;
}
}``````