Book of tasks on programming. Old version

 

 by Aliaksandr N. Prykhodzka

 

asm, sheet, ряд, исключение, система счисления, xsl, по программированию, private, college, scolaire, object, nil, прямое включение, процедурный, учебник
 

for valuable work you must have JavaScript (allow active content)

Visual Basic. B.4. Nest of tasks. Operator Do..Loop Until

 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.4.1     Answer      Pascal-analogue

Determine a value produced by function AA .


Function AA() As Integer
    xx = 0
    k = 0
    Do
        xx = xx + 1
        k = k + 1
    Loop Until k = 7
    AA = xx
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.4.2     Answer      Pascal-analogue

Determine a value produced by function AA .


Function AA() As Integer
    xx = 0
    k = 2
    Do
        xx = xx + 1
        k = k + 1
    Loop Until k = 7
    AA = xx
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.4.3     Answer      Pascal-analogue

Determine a value produced by function AA .


Function AA() As Integer
    xx = 0
    k = 0
    Do
        xx = xx + 1
        k = k + 3
    Loop Until k > 20
    AA = xx
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.4.4     Answer      Pascal-analogue

Determine a value produced by function AA .


Function AA() As Integer
    xx = 0
    k = 1
    Do
        xx = xx + 1
        k = k * 2
    Loop Until k > 30
    AA = xx
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.4.5     Answer      Pascal-analogue

Determine a value produced by function AA .


Function AA() As Integer
    xx = 0
    k = 0
    Do
        xx = xx + 1
        For j = 1 To 3
            k = k + 1
        Next j
    Loop Until k > 20
    AA = xx
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.4.6     Answer      Pascal-analogue

Determine a value produced by function AA .


Function AA() As Integer
    xx = 0
    k = 1
    Do
        xx = xx + 1
        For j = 1 To 2
            k = k * 2
        Next j
    Loop Until k > 60
    AA = xx
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.4.7     Answer      Pascal-analogue

Determine a value produced by function AA .


Function AA() As Integer
    xx = 0
    For k = 1 To 3
        Do
            xx = xx + 1
        Loop Until xx > 4
    Next k
    AA = xx
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.4.8     Answer      Pascal-analogue

Determine a value produced by function AA .


Function AA() As Integer
    xx = 0
    For k = 1 To 2
        Do
            xx = xx + 1
        Loop Until xx > 1
    Next k
    AA = xx
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.4.9     Answer      Pascal-analogue

Determine a value produced by function AA .


Function AA() As Integer
    xx = 0
    For k = 1 To 3
        Do
            xx = xx * 2 + 1
        Loop Until xx > 5
    Next k
    AA = xx
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.4.10     Answer      Pascal-analogue

Determine a value produced by function AA .


Function AA() As Integer
    xx = 0
    k = 0
    Do
        k = k + 1
        n = 0
        Do
            n = n + 1
            xx = xx + 1
        Loop Until n = 2
    Loop Until k = 3
    AA = xx
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.4.11     Answer      Pascal-analogue

Determine a value produced by function AA .


Function AA() As Integer
    xx = 0
    k = 0
    Do
        k = k + 2
        n = 0
        Do
            n = n + 3
            xx = xx + 1
        Loop Until n > k
    Loop Until k > 10
    AA = xx
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.4.12     Answer      Pascal-analogue

Determine a value produced by function AA .


Function AA() As Integer
    xx = 0
    k = 0
    Do
        xx = xx + 1
        k = k * 3 + 2
    Loop Until k > 20
    AA = xx
End Function



 

©   Aliaksandr Prykhodzka    1993 - 2007