Book of tasks on programming. Old version

 

 by Aliaksandr N. Prykhodzka

 

схема, преобразование, статический, game, library, обучение, until, disk, div, промежуточный, reusing, наследование, загрузочный, abstract, jstl, xslt
 

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

Visual Basic. B.9. Nest of tasks. Tasks on substitution

 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.1     Answer      Pascal-analogue      Java-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = ___
    For i = 1 To 3
        Man = Man + (i * 2 - 1)
    Next i
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.2     Answer      Pascal-analogue      Java-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = 0
    For i = 1 To ___
        Man = Man + (i * 3 + 1)
    Next i
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.3     Answer      Pascal-analogue      Java-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = 0
    For i = ___ To 6
        Man = Man + i
    Next i
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.4     Answer      Pascal-analogue      Java-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = 0
    For i = 1 To 2
        Man = Man + (i * ___ + 1)
    Next i
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.5     Answer      Pascal-analogue      Java-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = 7
    For i = 1 To ___
        Man = Man + (i * 2 - 1)
    Next i
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.6     Answer      Pascal-analogue      Java-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = 0
    For i = 1 To 5
        If i Mod ___ > 0 Then
            Man = Man + i
        End If
    Next i
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.7     Answer      Pascal-analogue      Java-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = 0
    For i = 4 To 6
        If i Mod 4 > 0 Then
            Man = Man + i
        End If
    Next i
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.8     Answer      Pascal-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = 20
    i = 4
    Do
        Man = Man - i
        i = i + 1
    Loop Until i = ___
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.9     Answer      Pascal-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = 20
    i = 2
    Do
        Man = Man - i
        i = i + 1
    Loop Until i = ___
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.10     Answer      Pascal-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = 25
    i = 2
    Do
        Man = Man - i
        i = i + 1
    Loop Until i = ___
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.11     Answer      Pascal-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = 31
    i = 2
    Do
        Man = Man - i
        i = i + 1
    Loop Until i = ___
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.12     Answer      Pascal-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = 32
    i = ___
    Do
        Man = Man - i
        i = i + 1
    Loop Until i = 7
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.13     Answer      Pascal-analogue      Java-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = 0
    For i = 1 To ___
        Man = Man + i
    Next i
    Man = Man - 10
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.14     Answer      Pascal-analogue      Java-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    i = ___
    If i Mod 2 = 0 Then
        Man = 2
    Else
        If i Mod 3 = 0 Then
            Man = 3
        Else
            If i Mod 5 = 0 Then
                Man = 5
            Else
                If i Mod 7 = 0 Then
                    Man = 11
                Else
                    Man = 12
                End If
            End If
        End If
    End If
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.15     Answer      Pascal-analogue      Java-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    i = ___
    If i Mod 2 > 0 Then
        Man = 2
    Else
        If i Mod 3 > 0 Then
            Man = 3
        Else
            If i Mod 5 > 0 Then
                Man = 5
            Else
                If i Mod 7 > 0 Then
                    Man = 11
                Else
                    Man = 12
                End If
            End If
        End If
    End If
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.16     Answer      Pascal-analogue      Java-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = 1
    For i = 1 To 5
        Man = Man * i
    Next i
    For i = 1 To ___
        Man = Man - 1
    Next i
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.17     Answer      Pascal-analogue      Java-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = 0
    For i = 1 To 5
        Man = Man + i
    Next i
    For i = 1 To ___
        Man = Man - 1
    Next i
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.18     Answer      Pascal-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = 0
    Do
        Man = Man + 1
    Loop Until Man * Man = ___
    AA = Man
End Function


 

 

Calculator

/ - division

\ - rest

S - sum of numbers from and to

P - multiply numbers from and to

B.9.19     Answer      Pascal-analogue      Java-analogue

Put numbers into empty places to function AA return 11.


Function AA() As Integer
    Man = 20
    For i = 1 To 3
        For j = 1 To ___
            Man = Man - 1
        Next j
    Next i
    AA = Man
End Function



 

©   Aliaksandr Prykhodzka    1993 - 2007