Solving the following Vb program requires a detailed explanation

Updated on technology 2024-02-08
7 answers
  1. Anonymous users2024-02-05

    fuction should be functional

    wub should be sub

    Contents of text box 1: 28

    Contents of text box 2: 73

    First: x=x+y=a+b=5+6=11

    y=y+x=b+11=6+11=17

    Now a=x=11, b=y=17

    Second: x=x+y=a+b=11+17=28y=y+x=b+18=17+28=45

    Now a=x=28, b=y=45

    The form is displayed:

  2. Anonymous users2024-02-04

    The content of text1 is calculated as follows:

    x=5+6=11

    y=6+11=17

    sum=11+17=28

    So the content of text1 is 28

    In the same way, the content of text2 is also 28, because the values of a and b do not change the content of text1 and text2 on the form, which are both 28, and the values of a and b are printed on the form 5 and 6

  3. Anonymous users2024-02-03

    It should be written like this:

    function sum(x as integer, y as integer) as integer

    x = x + y: y = y + x: sum = x + yend function

    private sub form_click()dim a as integer, b as integera = 5: b = 6

    sum(a, b)

    sum(a, b)

    print a, b

    end sub

    Tested: The content of text box 1 is 28

    The content in text box 2 is 73

    But the form shows 28, and 45

  4. Anonymous users2024-02-02

    It's so simple, it's a simple recursive sum.

    First, define x, y

    Then click on the event to execute (click on the event to define a, b).

    Then a=5:b=6

    b) Show sum to find the sum of ab.

    b) Finally output the calculation results.

  5. Anonymous users2024-02-01

    1. The value of a is a random integer between 0 and 99. Because the rnd function randomly generates a single-precision number (real number) between 0--1 (excluding 0 and 1), and then multiplies it by 100 to become a real number between 0--100, and int() is a rounding function, so the possible range of real numbers between 0--100 is 0--99, including 0 and 99.

    2. The program executes the insertion sorting algorithm. Judging from the part ** you provide, it should randomly generate an integer within 100, and find its position and insert it in the existing ascending sequence to generate a new sequence.

    3. The result is that the elements of the array d are arranged in descending order. This can be seen from the statement i=k do while i>1 and d(i-1)>a.

    4. The program is aimed at 1 number, which is a randomly generated A value.

  6. Anonymous users2024-01-31

    The value of a is a random integer between 0 and 99.

    The program executes a direct insertion sorting algorithm.

    As a result, the elements of array d are arranged in ascending order.

    This segment is inserted into an element.

  7. Anonymous users2024-01-30

    Run the loop i=1to20step2

    i=1, a=a+1=1+1=2, b=b-1=20-1=19, i=i+1=1+1=2, because step2, so i adds 2 more, i=4

    i=4, a=a+1=2+1=3, b=b-1=19-1=18, i=i+1=4+1=5, because step2, so i adds 2 more, i=7

    i=7, a=a+1=3+1=4, b=b-1=18-1=17, i=i+1=7+1=8, because step2, so i adds 2 more, i=10

    i=10, a=a+1=4+1=5, b=b-1=17-1=16, i=i+1=10+1=11, because step2, so i add 2 more, i=13

    i=13,a=a+1=5+1=6,b=b-1=16-1=15,i=i+1=13+1=14,because step2,so i add 2 more,i=16

    i=16, a=a+1=6+1=7, b=b-1=15-1=14, i=i+1=16+1=17, because step2, so i add 2 more, i=19

    i=19, a=a+1=7+1=8, b=b-1=14-1=13, i=i+1=19+1=20, because step2, so i add 2 more, i=22

    i=22 exceeds 20, stop the cycle.

    So the final result is a=8, b=13, i=22

    Hope...

Related questions
12 answers2024-02-08

Hehe, I'm glad to receive your request for help, the title is written like this. >>>More