Programming for calculating perimeter and area of rectangle with VB Programming of perimeter and area of rectangle

Programming for calculating perimeter and area of rectangle with VB Programming of perimeter and area of rectangle


Do you just need to program?
Private Sub Command1_ Click()
If Val(Text1.Text) > 0 And Val(Text2.Text) > 0 Then
Label1. Caption = & val (Text1. Text) * val (text2. Text)
Label2. Caption = & 2 * (Val (Text1. Text) + val (text2. Text))
Else
Msgbox "the data you entered is not standard, please re-enter!", "prompt"
End If
End Sub



VB programming questions. Input triangle three sides a, B, C value, according to its numerical value, judge whether to form a triangle. Do not require to judge what is a specific triangle


Private Sub Command2_ Click()
Dim a,b,c
a = Text1.Text
b = Text2.Text
c = Text3.Text
If a - b < c And a - c < b And b - c < a And a + b > c And a + c < b And b + c > a Then
Msgbox "the group number can form a triangle"
Else
Msgbox "the group number cannot form triangle"
End If
End Sub



The triangle knows how to calculate the perimeter of the area with the base of 24 and the height of 10
A triangle knows how to calculate its circumference by base 24 and height 10


Let the height of the triangle divide the base into two parts X and 24-x. the three sides of the triangle are 24, √ (10 & # 178; + X & # 178;), √ (10 & # 178; + (24-x) &# 178;), and the perimeter is the sum of the three. Let's look at two special cases: when x = 0 or 24, the triangle becomes a right triangle with straight sides 24 and 10, and the three sides are 24,10,26, and the perimeter is 60