Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Friday, July 29, 2011

VB-74 : Resultant Length of 2 concatenated Strings

Write a VB program to accept 2 given strings , concatenate them and find the  length of the  resultant string.

Refer  Total words,Characters,sentence,length of ... also.



(A)Program Design : 


(B) Property(Controls Used) :
  • 4 Labels 
  • 4 Text Boxes (Text 1,2,3,4)
  • One Command Button (Caption-Concatenate)

(C) Attaching Code to the Object :


Private Sub Command1_Click()

Text3.Text = Text1.Text & Text2.Text

Text4.Text = Len(Text3.Text)

End Sub


(D) Output :




(E) Errors :

If found any errors while running your VB program, or want to put your comment about any  program , please click Comment section , to post.


===============================================
===============================================


VB-73 : Calculate Area & Volume


Write a VB program for a company to produce various sized basketballs , to calculate the area and volume of different sized balls,so that they will know how much air to pump in the ball,and how much paint they will need to paint it.Radius may be taken from the user as input of the program.
Area=4*22/7*(Radius)^2
Volume=4/3 * 22/7 * (Radius)^3
======================================
 (A)Program Design : 

(B) Property(Controls Used) :
  • 3 Labels
  • 3 TextBoxes(Text 1,2,3)
  • One Command Button (Calculate)

(C) Attaching Code to the Object :
Private Sub Command1_Click()
Dim radius As Single
Dim area, volume As Double

radius = Val(Text1)
area = 4 * 22 / 7 * (radius * radius)
volume = 4 / 3 * 22 / 7 * (radius * radius * radius)

Text2 = Round(area, 2)
Text3 = Round(volume, 2)
End Sub



(D) Output :
(E) Errors :
If found any errors while running your VB program, please click this link   Possible Errors while running VB Programs to get a solution.

      • ====================================================================
        Back to Home   &  VB
    ===========================================================