1,a,Summarise the rules that apply to naming variables in visual basic
b, i.) Define a multi-component user-defined data type called AirHandler having the ff components:

colour (string)
MachineNo (long integer)
Length (single-precision real)
Breath (single-precision real)
Height (single-precision real)
Cost (single precision real)

ii)Declare a variable called AC_For_Barclays of type AirHandler,and assign the
following values to the components of AC_For_Barclays:Colour:green;
MachineNo:45658;Length:99.66;Breadth:45.82; Height:88.50;
Cost:45,548.55


2,Consider the ff Click event-handler for an ActiveX control named Command1 in visual Basic Programming:


Private Sub Command1_Click()

Dim str 'step 1

Dim str1 As String'str2 As string 'step 2

str1 = "240" 'step 3

str2 = "100" 'step 4

str = str1/str2 'step 5

MsgBox str 'step 6

End Sub

When an application containing the programme segment above is run, answer the ff when Command1 is clicked:

V. what variable type does str assumes in step 1?
VI.What will be the content of str in step 1?
VII.what data type will str hold in step 5?
VIII.what is the significance of the output message in step 6?

Well, we are not here to do your homework and so this means you will have to read your book and the help files to find out this information.

First hint, start a new standard exe project, press F1, and on the index tab, type in "data types". Hit enter, and when the dialog comes up, scroll down to "Data Types Keyword Summary Visual Basic Reference". What you want to look at are the Set intrinsic data types. Click on one, read it, ALT+LeftArrowKey (to move back to the page you were on.).

Then, when you are done reading about variant data type, while you are on that page, click on see also and select "Data Type Summary".

Good Luck

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.