operator=+
bewerking=bewerking2.proc
n=$teller
!if $graad=0
    R=$teller
!else
    R=$graad
!endif
!if $R=1    
    TELLER1=!randitem 1,2,3
    TELLER2=!randitem 1,2,3
    NOEMER1=!randitem 4,5,6,7
    factor=!randitem 2,3,4,5,6,7
    NOEMER2=$[$NOEMER1*$factor]    
    GOED1=$[$TELLER1*$factor]
    GOED2=$NOEMER2
    GOED3=$TELLER2
    GOED4=$NOEMER2
##ant1/ant2 + ant3/ant4 = ant5ant6 
##GOED1/GOED2 + GOED3/GOED4 = GOED5/GOED6
    GGG=!exec pari ($GOED1+$GOED3)/($GOED4) 
    !if / notin $GGG
	GOED5=$GGG
	GOED6=1
    !else
	GGG=!replace internal / by , in $GGG
        GOED5=!item 1 of $GGG
        GOED6=!item 2 of $GGG
    !endif
    antwoord$n=\frac{$TELLER1}{$NOEMER1} + \frac{$TELLER2}{$NOEMER2}  =\
    \frac{$factor \cdot $TELLER1}{$factor \cdot $NOEMER1} + \frac{$TELLER2}{$NOEMER2} =\
    \frac{$[$factor*$TELLER1] + $TELLER2 }{$NOEMER2}  =\
    \frac{$GOED5}{$GOED6} 
!endif

!if $R=2    
    TELLER1=!randitem 3,4,5,6
    TELLER2=!randitem 2,3,4,5,7,8,9
    NOEMER1=!randitem 7,8,9,10
    factor=!randitem 2,3,4,5,6,7
    NOEMER2=$[$NOEMER1*$factor]    
    GOED1=$[$TELLER1*$factor]
    GOED2=$NOEMER2
    GOED3=$TELLER2
    GOED4=$NOEMER2
##ant1/ant2 + ant3/ant4 = ant5ant6 
##GOED1/GOED2 + GOED3/GOED4 = GOED5/GOED6
    GGG=!exec pari ($GOED1+$GOED3)/($GOED4) 
    !if / notin $GGG
	GOED5=$GGG
	GOED6=1
    !else
	GGG=!replace internal / by , in $GGG
        GOED5=!item 1 of $GGG
        GOED6=!item 2 of $GGG
    !endif
    antwoord$n=\frac{$TELLER1}{$NOEMER1} + \frac{$TELLER2}{$NOEMER2}  =\
    \frac{$factor \cdot $TELLER1}{$factor \cdot $NOEMER1} + \frac{$TELLER2}{$NOEMER2} =\
    \frac{$[$factor*$TELLER1] + $TELLER2 }{$NOEMER2}  =\
    \frac{$GOED5}{$GOED6}
!endif

!if $R=3    
    TELLER1=!randitem 3,4,5,6
    TELLER2=!randitem 3,4,5,6
    NOEMER1=!randitem 10,11,12,13,14
    NOEMER2=!randitem 20,21,22,23,24
    GOED1=$[$TELLER1*$NOEMER2]
    GOED2=$[$NOEMER1*$NOEMER2]
    GOED3=$[$TELLER2*$NOEMER1]
    GOED4=$[$NOEMER1*$NOEMER2]
##ant1/ant2 + ant3/ant4 = ant5ant6 
##GOED1/GOED2 + GOED3/GOED4 = GOED5/GOED6
    GGG=!exec pari ($GOED1+$GOED3)/($GOED4) 
    !if / notin $GGG
	GOED5=$GGG
	GOED6=1
    !else
	GGG=!replace internal / by , in $GGG
        GOED5=!item 1 of $GGG
        GOED6=!item 2 of $GGG
    !endif
    antwoord$n=\frac{$TELLER1}{$NOEMER1} + \frac{$TELLER2}{$NOEMER2}  =\
    \frac{$TELLER1 \cdot $NOEMER2}{$NOEMER1 \cdot $NOEMER2} + \frac{$TELLER2 \cdot $NOEMER1}{$NOEMER2 \cdot $NOEMER1} =\
    \frac{$[$NOEMER2*$TELLER1] + $[$NOEMER1*$TELLER2] }{$[$NOEMER1*$NOEMER2]}  =\
    \frac{$GOED5}{$GOED6}
!endif

!if $R>3    
    TELLER1=!randitem 3,4,5,6,7,8,9
    TELLER2=!randitem 2,3,4,5,7,8,9
    NOEMER1=!randitem 11,12,13,14,15,16,17,18,19
    NOEMER2=!randitem 20,21,22,23,24,25,26,27,28,29
    GOED1=$[$TELLER1*$NOEMER2]
    GOED2=$[$NOEMER1*$NOEMER2]
    GOED3=$[$TELLER2*$NOEMER1]
    GOED4=$[$NOEMER1*$NOEMER2]
##ant1/ant2 + ant3/ant4 = ant5ant6 
##GOED1/GOED2 + GOED3/GOED4 = GOED5/GOED6
    GGG=!exec pari ($GOED1+$GOED3)/($GOED4) 
    !if / notin $GGG
	GOED5=$GGG
	GOED6=1
    !else
	GGG=!replace internal / by , in $GGG
        GOED5=!item 1 of $GGG
        GOED6=!item 2 of $GGG
    !endif
    antwoord$n=\frac{$TELLER1}{$NOEMER1} + \frac{$TELLER2}{$NOEMER2}  =\
    \frac{$TELLER1 \cdot $NOEMER2}{$NOEMER1 \cdot $NOEMER2} + \frac{$TELLER2 \cdot $NOEMER1}{$NOEMER2 \cdot $NOEMER1} =\
    \frac{$[$NOEMER2*$TELLER1] + $[$NOEMER1*$TELLER2] }{$[$NOEMER1*$NOEMER2]}  =\
    \frac{$GOED5}{$GOED6} 
!endif


!if $taal=nl
    nivo_title=twee breuken gelijknamig maken en optellen & vereenvoudigen.
    somtekst$n=<p align="left">Maak de volgende twee breuken <b>gelijknamig</b>.<br>\
    <small>maak dus de de noemers gelijk</small><br>\
    en tel ze daarna op...<br>\
    <small>Het eindantwoord moet je natuurlijk wel vereenvoudigen<br>\
    dus 2/4 wordt 1/2 .</small><p>
!else
    nivo_title=Addition of two fractions
    somtekst$n=<p align="left">First find a common denominator.<br>\
    And then add the two fractions.<br>\
    <small>naturally you must reduce the outcome<br>thus 2/4 --> 1/2</small><p>
!endif

opgave$n=\frac{$TELLER1}{$NOEMER1} + \frac{$TELLER2}{$NOEMER2} \,\,=\,\,
    
