Use the VB program to find the area of the circle, and how to write the program code in VB to calcul

Updated on technology 2024-03-18
3 answers
  1. Anonymous users2024-02-06

    Two commandbuttons, two lables, two texts"

    private sub command1_click()r =

    p =s = p * r * r

    sprivate sub command2_click()endprivate sub text1_lostfocus()clsr =

    circle (10000, 3000), r, vbblackif r > 3000 then

    msgbox "Overflow! "

    elseif r <= 0 then

    msgbox "The radius cannot be 0! "

    end if

    end if

    end sub

  2. Anonymous users2024-02-05

    In this example, the area of a circle will be calculated by the value of pi and the radius of the circle entered by the user.

    01 Locate the corresponding control in the toolbox and draw it in the appropriate position on the form.

    02 Next, let's start writing the click event for the calculated button. First, define two variables, r and s, where r is the radius and s is the area.

    03 Next, define a constant of pi, and the default value is set to.

    04 Let's start writing. (Because of the large number of lines in the program, it is not convenient to observe the unified writing of comments here, please see the comments in the program for the meaning of each sentence.) )

    05 Run the test by f5 and enter a radius of 3 in the box to calculate the result as.

    Note the rewriting of the formula, please use the power symbol " for squares, and use "*" for multiplication signs

  3. Anonymous users2024-02-04

    There is a fixed line and a moving line in the same plane, when this plane rotates around this fixed line, the surface formed by this moving line is called the rotating surface, this fixed line is called the axis of the rotating surface, and this moving line is called the bus bar of the rotating surface.

    The two round faces of a cylinder are called the bottom surface, and the surrounding faces are called the sides, and a cylinder is composed of two bottom surfaces and one side.

    The two undersides of a cylinder are two identical faces. The distance between the two bottom faces is the height of the cylinder.

    The side of the cylinder is a curved surface, and the side of the cylinder is illustrated as a rectangle, square, or parallelogram (oblique tangent).

    The side area of the cylinder = the circumference of the bottom surface x the height, i.e.:

    S side area = CH = 2 rh

    Circumference of the base surface c=2 r= d

    Surface area of the cylinder = side area + base area x2 = ch + 2 r 2 = 2 r (r + h).

    The volume of the cylinder = base area x height, i.e. v=s base area h=(r r)h

    I hope I can help you with your doubts.

Related questions
6 answers2024-03-18

Good question, write with a for loop and judgment statement. >>>More

6 answers2024-03-18

The second line declares that the textbox control array ** is wrong and does not conform to the syntax specification! >>>More

5 answers2024-03-18

The following methods are for reference.

Method 1: Use the sendkeys statement. >>>More

6 answers2024-03-18

I tried going downstairs with no problem. If it can't be opened, the landlord can try this sentence: (note that it is 3 quotation marks). >>>More

11 answers2024-03-18

Upstairs ** is so long, it's still simple?

Speechless. I wrote one for you, this is really simple and practical, hehe! >>>More