bewerking=bewerking1.proc

approx=<img src=$module_dir/gifs/approx.gif>
!readproc $authordir/afronding.$taal
somtekst=<em>$AFRONDING</em>
R=$graad
!if $taal=nl
    nivo_title=Bepaal de groeifactor.
    dingen=!shuffle zalm:Noordse fjorden,zeehonden:Waddenzee,kabeljauw:Atlantische Oceaan,platvis:Noordzee,dolfijnen:Stille Zuidzee,kokkels:Waddenzee,paling:Sargasso Zee,forel:de Rijn
    tijden1=!shuffle jaar:maand:1:12,maand:jaar:12:1,jaar:kwartaal:1:4,kwartaal:jaar:4:1,week:dag:1:7,dag:week:7:1
    tijden2=!shuffle uur:minuut:1:60,minuut:uur:60:1,minuut:seconde:1:60,seconde:minuut:60:1,uur:kwartier:1:4,kwartier:uur:4:1,kwartier:minuut:1:15,minuut:kwartier:15:1
    

    !for n=1 to $aantal_sommen
	ding=!item $n of $dingen
	ding=!replace internal : by , in $ding
	beest=!item 1 of $ding
	zee=!item 2 of $ding
	keuze=!randitem 1,0
	!if $graad =0
	    #doorlopen van makkelijk naar moeilijk
	    R=$n
	!endif    
	!if $R = 1
	    percentage$n=0
	    p=!randint 10,200
	    p=$[$p/10]
	    !if $keuze=1
	        GOED$n=$[(100+$p)/100]
		goed$n=De groeifactor is dan <b>(100 + $p)/100 = $(GOED$n)</b>
		somtekst$n=De hoeveelheid $beest in de $zee neemt elk jaar met <b>$p</b> % toe.<br>\
		Bepaal de <b>groeifactor</b> bij deze toename. 
	    !else
		GOED$n=$[(100-$p)/100]
		goed$n=De <b>groeifactor</b> is dan <b>(100 - $p)/100 = $(GOED$n)</b>
		somtekst$n=De hoeveelheid $beest in de $zee neemt elk jaar met <b>$p</b> % af.<br>\
		Bepaal de <b>groeifactor</b> bij deze afname. 
	    !endif
	!endif
	!if $R = 2 
	    p=!randint 10,200
	    p=$[$p/10]
	    percentage$n=1
	    !if $keuze=1
		factor=$[(100+$p)/100]
		GOED$n=$p
		goed$n=Het <b>groeipercentage</b> is <b>($factor - 1)&times;100 % = $(GOED$n) %</b>
		somtekst$n=De hoeveelheid $beest in de $zee neemt exponentieel toe.<br>\
		De <b>groeifactor</b> per jaar bij deze toename is <b>$factor</b>. <br>Bepaal het hierbij horende <b>groeipercentage</b>.  
	    !else
		factor=$[(100-$p)/100]
		GOED$n=$p
		goed$n=Het <b>groeipercentage</b> is <b>(1 - $factor)&times;100 % = $(GOED$n) %</b>
		somtekst$n=De hoeveelheid $beest in de $zee neemt exponentieel af.<br>\
		De <b>groeifactor</b> per jaar bij deze afname is <b>$factor</b>.<br>Bepaal het hierbij horende <b>groeipercentage</b> . 
	    !endif
	!endif
	!if $R = 3     
	    !if $keuze=1
		p=!randint 50,200
	        !if $p=100
		    p=75
		!endif
	        p=$[$p/100]
		tijd=!item $n of $tijden1
		tijd=!replace internal : by , in $tijd
		T1=!item 1 of $tijd
		T2=!item 2 of $tijd
		f1=!item 3 of $tijd
		f2=!item 4 of $tijd
		!if $f2=1
		    factor=$f1
		!else
		    factor=$f1/$f2
		!endif
		!if $p>1
		    somtekst$n=Een populatie $beest groeit exponentieel.<br> We weten dat de <b>groeifactor</b><b> $p </b> per <b> $T1 </b>  is<br>\
		    Reken deze factor om naar een <b>groeifactor</b> per <b> $T2 </b>
		!else
		    somtekst$n=Een populatie $beest krimpt exponentieel. We weten dat de <b>groeifactor</b> <b> $p </b> per <b> $T1 </b> is<br>\
		    Reken deze factor om naar een <b>groeifactor</b> per <b>$T2</b>
		!endif
	    !else
		bacterie=!randitem schimmel,gist,streptokokken,salmonella bacteri&euml;n
	        p=!randint 90,115
		!if $p=100
		    p=95
		!endif
	        p=$[$p/100]
	    	tijd=!item $n of $tijden2
		tijd=!replace internal : by , in $tijd
		T1=!item 1 of $tijd
		T2=!item 2 of $tijd
		f1=!item 3 of $tijd
		f2=!item 4 of $tijd
		!if $f2=1
		    factor=$f1
		!else
		    factor=$f1/$f2
		!endif
	
		!if $p>1
		    somtekst$n=Op een agar-agar voedingsbodem groeit een hoeveelheid $bacterie exponentieel.<br>\
		    De <b>groeifactor</b> per <b>$T1</b> is <b>$p</b><br>\
		    Reken deze factor om naar een <b>groeifactor</b> per <b>$T2</b>
		!else
		    somtekst$n=Een desinfectiemiddel zorgt voor een exponenti&euml;le daling van een hoeveelheid $bacterie .<br>\
		    De <b>groeifactor</b> per <b>$T1</b> is <b>$p</b><br>Reken deze factor om naar een <b>groeifactor</b> per <b>$T2</b>		
		!endif
	    !endif	
	    percentage$n=0
	    GOED$n=$[(round($afrondingsfactor*$p^($factor)))/$afrondingsfactor]
	    goed$n=$p is de <b>groeifactor</b> per $T1 <br>\
	    De verhouding tussen een<b> $T1 </b> en een <b> $T2 </b> is <b> $f1:$f2 </b><br>\
	    Dus is de <b>groeifactor</b> per $T2 <b> $p<sup> $factor </sup> $approx  $(GOED$n) </b>
	!endif
	
	!if $R > 3 
	    percentage$n=1
	    !if $keuze=1
		p=!randint 50,200
	        !if $p=100
		    p=75
		!endif
	        p=$[$p/100]
		tijd=!item $n of $tijden1
		tijd=!replace internal : by , in $tijd
		T1=!item 1 of $tijd
		T2=!item 2 of $tijd
		f1=!item 3 of $tijd
		f2=!item 4 of $tijd
		!if $f2=1
		    factor=$f1
		!else
		    factor=$f1/$f2
		!endif
		!if $p>1
		    GOED$n=$[(round($afrondingsfactor*(100*($p^($factor)-1))))/$afrondingsfactor]
		    somtekst$n=Een populatie $beest groeit exponentieel.<br>\
		    We weten dat de <b>groeifactor</b> per <b>$T1</b> <b>$p</b> is<br>\
		    Bereken hoeveel <b>procent</b> deze populatie $beest per <b>$T2</b> toeneemt.
		    goed$n=$p is de <b>groeifactor</b> per $T1 <br>\
		    De verhouding tussen een<b> $T1 </b> en een <b> $T2 </b> is <b> $f1:$f2 </b><br>\
		    Dus is de <b>groeifactor</b> per $T2 <b> $p<sup> $factor </sup> = $[$p^($factor)] </b><br>\
		    Dus <b> 100&times; ( $[$p^($factor)] - 1 ) % $approx $(GOED$n) % </b>
		!else
		    GOED$n=$[(round($afrondingsfactor*(100*(1- $p^($factor)))))/$afrondingsfactor]
		    somtekst$n=Een populatie $beest krimpt exponentieel.<br>\
		    We weten dat de <b>groeifactor</b> per <b>$T1</b> <b>$p</b> is<br>\
		    Bereken hoeveel <b>procent</b> deze populatie $beest per <b>$T2</b> afneemt.
		    goed$n=$p is de <b>groeifactor</b> per $T1 <br>\
		    De verhouding tussen een<b> $T1 </b> en een <b> $T2 </b> is <b> $f1:$f2 </b><br>\
		    Dus is de <b>groeifactor</b> per $T2 <b> $p<sup> $factor </sup> = $[$p^($factor)] </b><br>\
		    Dus <b> 100&times; ( 1 - $[$p^($factor)]  ) % $approx $(GOED$n) % </b>
		!endif
	    !else
		bacterie=!randitem schimmel,gist,streptokokken,salmonella bacteri&euml;n
	        p=!randint 90,115
		!if $p=100
		    p=95
		!endif
	        p=$[$p/100]
	    	tijd=!item $n of $tijden2
		tijd=!replace internal : by , in $tijd
		T1=!item 1 of $tijd
		T2=!item 2 of $tijd
		f1=!item 3 of $tijd
		f2=!item 4 of $tijd
		!if $f2=1
		    factor=$f1
		!else
		    factor=$f1/$f2
		!endif
		!if $p>1
		    GOED$n=$[(round($afrondingsfactor*(100*($p^($factor)-1))))/$afrondingsfactor]
		    goed$n=$p is de <b>groeifactor</b> per $T1 <br>\
		    De verhouding tussen een<b> $T1 </b> en een <b> $T2 </b> is <b> $f1:$f2 </b><br>\
		    Dus is de <b>groeifactor</b> per $T2 <b> $p<sup> $factor </sup> = $[$p^($factor)] </b><br>\
		    Dus <b> 100&times; ( $[$p^($factor)] - 1 ) % $approx $(GOED$n) % </b>
		    
		    somtekst$n=Op een agar-agar voedingsbodem groeit een hoeveelheid $bacterie exponentieel.<br>\
		    De <b>groeifactor</b> per <b>$T1</b> is <b>$p</b><br>\
		    Bereken hoeveel <b>procent</b> deze hoeveelheid $bacterie per <b>$T2</b> toeneemt.
		!else
		    GOED$n=$[(round($afrondingsfactor*(100*(1- $p^($factor)))))/$afrondingsfactor]
		    goed$n=$p is de <b>groeifactor</b> per $T1 <br>\
		    De verhouding tussen een<b> $T1 </b> en een <b> $T2 </b> is <b> $f1:$f2 </b><br>\
		    Dus is de <b>groeifactor</b> per $T2 <b> $p<sup> $factor </sup> = $[$p^($factor)] </b><br>\
		    Dus <b>100&times; ( 1 - $[$p^($factor)]  ) % $approx $(GOED$n) % </b>
		    
		    somtekst$n=Een desinfectiemiddel zorgt voor een exponenti&euml;le daling van een hoeveelheid $bacterie .<br>\
		    De <b>groeifactor</b> per <b>$T1</b> is <b>$p</b><br>\
		    Bereken hoeveel <b>procent</b> deze hoeveelheid $bacterie per <b>$T2</b> afneemt		
		!endif
	    !endif	
	!endif
    !next n        
!else
    # $taal != nl
    nivo_title=Determine the "growth factor"
    dingen=!shuffle salmon:Nordic Fjords,seals:Dutch Wadden,cod:Atlantic Ocean,flatfish:North Sea,eel:Sargasso Sea,dolphins:Indian Ocean
    tijden1=!shuffle year:month:1:12,month:year:12:1,year:quarter:1:4,quarter:year:4:1,week:day:1:7,day:week:7:1
    tijden2=!shuffle hour:minute:1:60,minute:hour:60:1,minute:second:1:60,second:minute:60:1,hour:quarter:1:4,quarter:hour:4:1,quarter:minute:1:15,minute:quarter:15:1

    !for n=1 to $aantal_sommen
	ding=!item $n of $dingen
	ding=!replace internal : by , in $ding
	beest=!item 1 of $ding
	zee=!item 2 of $ding
	keuze=!randitem 1,0
	!if $graad =0
	    #doorlopen van makkelijk naar moeilijk
	    R=$n
	!endif    
	!if $R = 1
	    percentage$n=0
	    p=!randint 10,200
	    p=$[$p/10]
	    !if $keuze=1
	        GOED$n=$[(100+$p)/100]
		goed$n=the <b>growth factor</b> is <b>(100 + $p)/100 = $(GOED$n)</b>
		somtekst$n=The total amount of $beest in the $zee increases every year with <b>$p</b> % .<br>\
		Determine the growth-factor.
	    !else
		GOED$n=$[(100-$p)/100]
		goed$n=De <b>growth factor</b> <b>(100 - $p)/100 = $(GOED$n)</b>
		somtekst$n=the total amount of $beest in the $zee decreases every year with <b>$p</b> % .<br>\
		determine the <b>growth factor</b>. 
	    !endif
	!endif
	!if $R = 2 
	    percentage$n=1 
	    p=!randint 10,200
	    p=$[$p/10]
	    !if $keuze=1
		factor=$[(100+$p)/100]
		GOED$n=$p
		goed$n=The percentage growth is <b>($factor - 1)&times;100 % = $(GOED$n) %</b>
		somtekst$n=The amount of $beest in the $zee increases exponentially.<br>\
		The <b>growth factor</b> of this proces is <b>$factor</b>. <br>Determine the corresponding <b>percentage</b> of growth.
	    !else
		factor=$[(100-$p)/100]
		GOED$n=$p
		goed$n=The percentage of growth is <b>(1 - $factor)&times;100 % = $(GOED$n) %</b>
		somtekst$n=The amount of $beest in the $zee decreases exponentially.<br>\
		The <b>growth factor</b> of this proces is <b>$factor</b>. <br>Determine the corresponding <b>percentage</b> of growth.	
	    !endif
	!endif
	!if $R = 3     
	    percentage$n=0
	    !if $keuze=1
		p=!randint 50,200
	        !if $p=100
		    p=75
		!endif
	        p=$[$p/100]
		tijd=!item $n of $tijden1
		tijd=!replace internal : by , in $tijd
		T1=!item 1 of $tijd
		T2=!item 2 of $tijd
		f1=!item 3 of $tijd
		f2=!item 4 of $tijd
		!if $f2=1
		    factor=$f1
		!else
		    factor=$f1/$f2
		!endif
		!if $p>1
		    somtekst$n=A population of $beest shows an exponential growth.<br>\
		    We know the <b>growth factor</b> <b>$p</b> per <b>$T1</b> is<br>\
		    Recalculate this factor to a <b>growth factor</b> per <b>$T2</b>.
		!else
		    somtekst$n=A population of $beest shows an exponential decrease .<br>\
		    We know the <b>growth factor</b> <b>$p</b> per <b>$T1</b> is<br>\
		    Recalculate this factor to a <b>growth factor</b> per <b>$T2</b>.
		!endif
	    !else
		bacterie=!randitem fungus,yeast,streptococs,salmonella bacteria
	        p=!randint 90,115
		!if $p=100
		    p=95
		!endif
	        p=$[$p/100]
	    	tijd=!item $n of $tijden2
		tijd=!replace internal : by , in $tijd
		T1=!item 1 of $tijd
		T2=!item 2 of $tijd
		f1=!item 3 of $tijd
		f2=!item 4 of $tijd
		!if $f2=1
		    factor=$f1
		!else
		    factor=$f1/$f2
		!endif
	
		!if $p>1
		    somtekst$n=The $bacterie on an agar-agar medium grows exponentially.<br>\
		    The <b>growth factor</b> per <b>$T1</b> is <b>$p</b><br>\
		    Recalculate this factor to a <b>growth factor</b> per <b>$T2</b>.
		!else
		    somtekst$n=A desinfection agent gives an exponential decrease of the amount of  $bacterie .<br>\
		    The <b>growth factor</b> per <b>$T1</b> is <b>$p</b><br>\
		    Recalculate this factor to a <b>growth factor</b> per <b>$T2</b>.
		!endif
	    !endif	
	    GOED$n=$[(round($afrondingsfactor*$p^($factor)))/$afrondingsfactor]
	    goed$n=$p is the <b>growth factor</b> per $T1 <br>\
	    the ratio between  <b> $T1 </b> and <b> $T2 </b> is <b> $f1:$f2 </b><br>\
	    So the <b>growth factor</b> per $T2 <b> $p<sup> $factor </sup> $approx  $(GOED$n) </b>
	!endif
	!if $R > 3 
	    percentage$n=1
	    !if $keuze=1
		p=!randint 50,200
	        !if $p=100
		    p=75
		!endif
	        p=$[$p/100]
		tijd=!item $n of $tijden1
		tijd=!replace internal : by , in $tijd
		T1=!item 1 of $tijd
		T2=!item 2 of $tijd
		f1=!item 3 of $tijd
		f2=!item 4 of $tijd
		!if $f2=1
		    factor=$f1
		!else
		    factor=$f1/$f2
		!endif
		!if $p>1
		    GOED$n=$[(round($afrondingsfactor*(100*($p^($factor)-1))))/$afrondingsfactor]
		    somtekst$n=A population of $beest increases exponentially.<br>\
		    We know the <b>growth factor</b> per <b>$T1</b> is <b>$p</b>.<br>\
		    Calculate the <b>percentage</b> this population of $beest increases per <b>$T2</b>.
		    goed$n=$p is the <b>growth factor</b> per $T1 <br>\
		    The ratio between <b>$T1</b> and <b> $T2 </b> is <b>$f1:$f2</b><br>\
		    So the <b>growth factor</b> per $T2 <b> $p<sup> $factor </sup> = $[$p^($factor)] </b><br>\
		    And thus <b> 100&times; ( $[$p^($factor)] - 1 ) % $approx $(GOED$n) % </b>
		!else
		    GOED$n=$[(round($afrondingsfactor*(100*(1- $p^($factor)))))/$afrondingsfactor]
		    somtekst$n=A population of $beest decreases exponentially.<br>\
		    We know the <b>growth factor</b> per <b>$T1</b> is <b>$p</b>.<br>\
		    Calculate the <b>percentage</b> this population of $beest decreases per <b>$T2</b>.
		    goed$n=$p is the <b>growth factor</b> per $T1 <br>\
		    The ratio between <b>$T1</b> and <b>$T2</b> is <b>$f1:$f2</b><br>\
		    So the <b>growth factor</b> per $T2 <b> $p<sup> $factor </sup> = $[$p^($factor)] </b><br>\
		    And thus <b>100&times; ( 1 - $[$p^($factor)]  ) % $approx $(GOED$n) % </b>
		!endif
	    !else
		bacterie=!randitem fungus,yeast,streptococs,salmonella bacteria
		p=!randint 90,115
		!if $p=100
		    p=95
		!endif
	        p=$[$p/100]
	    	tijd=!item $n of $tijden2
		tijd=!replace internal : by , in $tijd
		T1=!item 1 of $tijd
		T2=!item 2 of $tijd
		f1=!item 3 of $tijd
		f2=!item 4 of $tijd
		!if $f2=1
		    factor=$f1
		!else
		    factor=$f1/$f2
		!endif
		!if $p>1
		    GOED$n=$[(round($afrondingsfactor*(100*($p^($factor)-1))))/$afrondingsfactor]
		    goed$n=$p is the <b>growth factor</b> per $T1 <br>\
		    The ratio between <b>$T1</b> and <b>$T2</b> is <b>$f1:$f2</b><br>\
		    So the <b>growth factor</b> per $T2 <b> $p<sup> $factor </sup> = $[$p^($factor)] </b><br>\
		    And this <b> 100&times; ( $[$p^($factor)] - 1 ) % $approx $(GOED$n) % </b>
		    
		    somtekst$n=The amount of $bacterie growth exponentially in a petri-dish on an Agar-Agar medium.<br>\
		    The <b>growth factor</b> per <b>$T1</b> is <b>$p</b><br>\
		    Calculate the <b>percentage</b> this population $bacterie increases per <b>$T2</b>.
		!else
		    GOED$n=$[(round($afrondingsfactor*(100*(1- $p^($factor)))))/$afrondingsfactor]
		    goed$n=$p is the <b>growth factor</b> per $T1 <br>\
		    The ratio between <b>$T1</b> and <b>$T</b> is <b>$f1:$f2</b><br>\
		    So the <b>growth factor</b> per $T2 <b>$p<sup>$factor</sup> = $[$p^($factor)] </b><br>\
		    Thus <b>100&times; ( 1 - $[$p^($factor)]  ) % $approx $(GOED$n) % </b>
		    
		    somtekst$n=A desinfection agent decreases the amount of $bacterie .<br>\
		    The <b>growth factor</b> per <b>$T1</b> is <b>$p</b><br>\
		    Calculate the <b>percentage</b> this population $bacterie decreases per <b>$T2</b>.
		!endif
	    !endif	
	!endif
    !next n        

!endif

teller=$aantal_sommen