bewerking=bewerking1.proc
!readproc $authordir/afronding.$taal
R=$graad
keuze=!randitem 1,0
!if $taal=nl
    nivo_title=graad=$graad Bepaal het percentage.
    !for n=1 to $aantal_sommen
	percentage$n=0
	!if $graad = 0
	#doorlopen van makkelijk naar moeilijk
	    R=$n
	!endif    
	!if $R = 1
	    A=!randint 1,100
	    B=!randint 10,500
	    !if $keuze=1
		GOED$n=$[(round($afrondingsfactor*($B - $A*$B/100)))/$afrondingsfactor]
		goed$n=De verkoopprijs wordt dan $B - $[$A/100] &times; $B <br>dus $(GOED$n) &euro;
		somtekst$n=Als je <b>$A %</b> korting krijgt op een artikel van <b>$B</b> &euro;<br>Wat is dan de verkoopprijs?? 
		keuze=0
	    !else
		GOED$n=$[(round($afrondingsfactor*($B + $A*$B/100)))/$afrondingsfactor]
		goed$n=De verkoopprijs wordt dan $B + $[$A/100] &times; $B <br>dus $(GOED$n) &euro;
		somtekst$n=Als je <b>$A %</b> milieu-toeslag krijgt op een artikel van <b>$B</b> &euro;<br>Wat is dan de verkoopprijs?? 
		keuze=1
	    !endif
	!endif
	!if $R = 2 
	    A=!randint 5,21
	    B=!randint 10,500
	    !if $keuze=1	
		GOED$n=$[(round($afrondingsfactor*($B*100)/(100-$A)))/$afrondingsfactor]
		goed$n=Het artikel zonder korting kost dan $B/$[(100 - $A)] &times; 100 <br> dus $(GOED$n) &euro;
		somtekst$n=Als een artikel met <b>$A %</b> discountkorting <b>$B</b> &euro; kost <br> Wat kost dan dat artikel zonder deze korting?	    
		keuze=0
	    !else	
		GOED$n=$[(round($afrondingsfactor*($B*100)/(100+$A)))/$afrondingsfactor]
		goed$n=Het artikel exclusief BTW kost dan  $B/$[(100 + $A)] &times; 100 <br> dus $(GOED$n) &euro;
		somtekst$n=Als een artikel inclusief <b>$A %</b> B.T.W. heffing  <b>$B</b> &euro; kost <br> Wat kost dan dat artikel exclusief deze belastingheffing?	    
		keuze=1
	    !endif
	!endif
	!if $R = 3 
	    B=!randint 500,3000
	    C=!randitem 2,3,4,5,6,7,8
	    !if $keuze=1
		A=!randitem 1.25,1.75,2.0,2.25,2.5,2.75,3.0,3.25,3.5,3.75,4.0,4.25,4.5,4.75
		GOED$n=$[(round($afrondingsfactor*$B*(((100+$A)/100)^$C)))/$afrondingsfactor]
		goed$n=In totaal heb je dan $B&times;((100+$A)/100)<sup>$C</sup> op je bankrekening staat<br>dus $(GOED$n) &euro;
		somtekst$n=Je hebt <b>$B</b> &euro; op je spaarrekening staan.<br>\
		Als de rente op deze spaarrekening <b>$A</b> % per jaar bedraagt<br>hoeveel heb je dan in totaal op je rekening staan na <b>$C</b> jaar?? 	    
		keuze=0
	    !else
		A=!randitem 9.25,10.5,11.75,12.85,13.45,14.25,15.55,16.35,17.15,18.95,19.85,20.75,21.35,22.45,23.25,24.1
		GOED$n=$[(round($afrondingsfactor*$B*(($A)/100)*$C))/$afrondingsfactor]
		goed$n=Je bent dan aan deze woekerrente $B&times;$[$A/100]&times;$C</sup> &euro; kwijt...<br>Dus $(GOED$n) &euro; !!!
		somtekst$n=Je bent een persoonlijke-lening van <b>$B</b> &euro; aangegaan bij een kredietbank (noooooit doen, hoor!)<br>\
		Als de rente op deze lening <b>$A %</b> per jaar bedraagt<br>Hoeveel &euro; ben je dan -zonder aflossen- kwijt aan deze rente in <b>$C</b> jaar ? 	    
		keuze=1
	    !endif	
	!endif
	!if $R > 3 
	    A=!randint 1,2,3,4,5,6,7,8
	    C=!randitem 2,3,4,5,6,7,8
	    B=!randint 10,500
	    prijs=$[(round($afrondingsfactor*$B*(((100-$A)/100)^$C)))/$afrondingsfactor]
	    !if $keuze=1
	        somtekst$n=Als een artikel van <b>$B</b> &euro; in de <em><font color=$fontcolor3>knettergekke</font> verkoopweken</em> elke week <b>$A %</b> goedkoper wordt <br>\
	        wat wordt dan de prijs na <b>$C</b> weken?
		GOED$n=$prijs
		goed$n=De prijs na $C weken kun je uitrekenen via $B*$[((100-$A)/100)]<sup>$C</sup> <br> en dat is dan ongeveer $prijs &euro;
		keuze=0
	    !else
	        somtekst$n=Als een artikel van <b>$B</b> &euro; in de <em><font color=$fontcolor3>knettergekke</font> verkoopweken</em> elke week <b>$A %</b> goedkoper wordt <br>\
	        na hoeveel weken is de prijs dan <b>$prijs</b> ? <br>bereken met behulp van <em>inklemmen</em>
		GOED$n=$C
		goed$n=Na inklemmen blijkt dat na $C weken de prijs $prijs &euro; is ...
		keuze=1
	    !endif	
	!endif
    !next n        
!else
    nivo_title=Calculate the percentage
    percentage$n=0
    !for n=1 to $aantal_sommen
	keuze=!randitem 1,0
	!if $graad = 0
	#doorlopen van makkelijk naar moeilijk
	    R=$n
	!endif    
	!if $R = 1
	    A=!randint 1,100
	    B=!randint 10,500
	    !if $keuze=1
		GOED$n=$[(round($afrondingsfactor*($B - $A*$B/100)))/$afrondingsfactor]
		goed$n=The discount price becomes  $B - $[$A/100] &times; $B <br>so $(GOED$n) &euro;
		somtekst$n=If you get <b>$A %</b> discount on an article of <b>$B</b> &euro; ,<br>what is the price you have to pay ? 
		keuze=0
	    !else
		GOED$n=$[(round($afrondingsfactor*($B + $A*$B/100)))/$afrondingsfactor]
		goed$n=The final price including the extra charge is $B + $[$A/100] &times; $B <br>so $(GOED$n) &euro;
		somtekst$n=If you get <b>$A %</b> additional charge on an article of <b>$B</b> &euro;,<br>what price do you have to pay for this article ? 
	    !endif
	!endif
	!if $R = 2 
	    A=!randint 5,21
	    B=!randint 10,500
	    !if $keuze=1	
		GOED$n=$[(round($afrondingsfactor*($B*100)/(100-$A)))/$afrondingsfactor]
		goed$n=The article without discount costs $B/$[(100 - $A)] &times; 100 <br> so $(GOED$n) &euro;
		somtekst$n=An article including <b>$A %</b> discount costs <b>$B</b> &euro; .<br> What is the price of the article without discount?	    
		keuze=0
	    !else	
		GOED$n=$[(round($afrondingsfactor*($B*100)/(100+$A)))/$afrondingsfactor]
		goed$n=Het article exclusief VAT kost dan  $B/$[(100 + $A)] &times; 100 <br> dus $(GOED$n) &euro;
		somtekst$n=An article including <b>$A %</b> VAT(tax) charge costs <b>$B</b> &euro; .<br> What is the price excluding VAT charge?
		keuze=1
	    !endif
	!endif
	!if $R = 3 
	    B=!randint 500,3000
	    C=!randitem 2,3,4,5,6,7,8
	    !if $keuze=1
		A=!randitem 1.25,1.75,2.0,2.25,2.5,2.75,3.0,3.25,3.5,3.75,4.0,4.25,4.5,4.75
		GOED$n=$[(round($afrondingsfactor*$B*(((100+$A)/100)^$C)))/$afrondingsfactor]
		goed$n=the total amount of money: $B&times;((100+$A)/100)<sup>$C</sup> on your savings account<br>so $(GOED$n) &euro;
		somtekst$n=You own <b>$B</b> &euro; on your savings account.<br>If the annual interest rate on this account is <b>$A</b> % <br>What is your capital on this account after <b>$C</b> year?? 	    
		keuze=0
	    !else
		A=!randitem 9.25,10.5,11.75,12.85,13.45,14.25,15.55,16.35,17.15,18.95,19.85,20.75,21.35,22.45,23.25,24.1
		GOED$n=$[(round($afrondingsfactor*$B*(($A)/100)*$C))/$afrondingsfactor]
		goed$n=You would have lost $B&times;$[$A/100]&times;$C</sup> &euro; in paying the interest.<br>so $(GOED$n) &euro; !!!
		somtekst$n=You've contracted a loan of <b>$B</b> &euro; at your credit bank.<br>\
		If the annual interest rate on this loan is <b>$A %</b> .<br>What's the small capital (in &euro;) you've lost paying interest after <b>$C</b> year <smal>without repayment</small>? 	    
		keuze=1
	    !endif	
	!endif
	!if $R > 3 
	    A=!randint 1,2,3,4,5,6,7,8
	    C=!randitem 2,3,4,5,6,7,8
	    B=!randint 10,500
	    prijs=$[(round($afrondingsfactor*$B*(((100-$A)/100)^$C)))/$afrondingsfactor]
	    !if $keuze=1
	        somtekst$n=If an artical of <b>$B</b> &euro;  gets <b>$A %</b> cheaper,<br> every week during the <font color=$fontcolor3>summer whole sales</font> <br>what is the price after <b>$C</b> weeks?
		GOED$n=$prijs
		goed$n=the price after $C weeks can be calculated like:  $B*$[((100-$A)/100)]<sup>$C</sup> <br> and that's approximately $prijs &euro;
		keuze=0
	    !else
	        somtekst$n=If an artical of <b>$B</b> &euro; gets <b>$A %</b> cheaper,<br> every week during the <font color=$fontcolor3>summer whole sales</font> <br>\
		After how many weeks is the price dropped to <b>$prijs</b> &euro; ?<br><small>you may round of at 2 decimals</small> 
		GOED$n=$C
		goed$n=After $C weeks is the price dropped to $prijs &euro; ...
		keuze=1
	    !endif	
	!endif
    !next n        
!endif

teller=$aantal_sommen