answersLogoWhite

0

📱

Visual Basic Programming

Visual Basic programming involves the use of a language that allows programmers to create simple and complex applications. It is a combination of visually organizing components or controls, specifying their attributes and actions, and writing additional codes for better functionality.

903 Questions

What is the difference between Visual Basic and Visual Basic.NET?

Differences between .Net and Java include

  • Java is from Sun, .Net is from Microsoft
  • Java is a language plus a runtime, .Net is a runtime framework that supports multiple languages, Visual Basic and C# (the .Net language most similar to Java) among them.
  • C# is very similar to Java but a few years younger, and a bit nicer in some respects - it has a slightly simpler syntax for some common constructs.
  • Java is more platform independent, it runs on several operating systems including Windows, Mac and Linux. .Net is primarily for Windows. Although the open source project Mono is developing a multi-platform runtime for .Net, so this is less of an issue than it used to be.
  • .Net has a more integrated development environment, as the IDE, runtime and server all come from Microsoft as a standard package, while Java is based on third-party tool and server providers. It used to be the case that the .Net development environment was clearly superior, but the difference is smaller these days.
  • It can be argued that Java gives more flexibility, as there are more server- and IDE-providers to choose from, at the cost of some extra overhead for the developer to get the different pieces to work together.

Functionality wise, there is not a lot of difference between the two, at least not when used to develop web applications.

For desktop applications, .Net naturally has an edge in Windows integration.

note: Oracle bought Sun Microsystems (Sun).

Why visual basic is called ide?

It isn't. Visual Basic is a programming language. Visual Studio is the IDE (integrated development environment). The Visual Studio IDE can be used to write programs in other languages besides Visual Basic, including Visual C++, Visual C#, Visual F, JavaScript and Python. The IDE provides all the tools you need to write programs in any of these languages but can be customised to support others. The languages available depend upon which languages you have installed or added to the IDE.

What is object oriented programming and visual basic.net?

Yes, Visual basic uses Objects. I.E. buttons, options buttons, forms, text boxes, these are all objects in VB. VB also allows the creation and use of COM classes.

Visual basic is partially OOP as it does not support implementation inheritance, which is usually a feature of an object-oriented language.

What is a bug in visual basic?

A "bug" is another word for an error. This usually arises if their is a problem with the code or a code's result.

Code for scientific calculator in visual basic?

Prep work: add 3 textboxes and 4 buttons

Button1 = Add

Button2 = Subtract

Button3 = Multiply

Button4 = Divide

Make sure to keep a textbox for the answer (I'll use one called, "TextBox3")

For Button 1:

TextBox3.Text = Val(TextBox1.Text) + Val(TextBox2.text)

'This takes text1's value and adds text2's value to it

For Button 2:

TextBox3.Text = Val(TextBox1.Text) - Val(TextBox2.Text)

'same as button one but subtract

For Button 3:

TextBox3.Text = Val(TextBox1.Text) * Val(TextBox2.Text)

For Button 4:

TextBox3.Text = Val(TextBox1.Text) / Val(TextBox2.Text)

What is an odd and even number program in visual basic?

I don't now visual basic, but to determine whether or not a number is even or odd, divide it by two twice, and round once. If the rounded result is equal to the non-rounded result, then the original number is even:

input n

if (n/2.0) == int(n/2.0)

print "the number is even"

How do you create an array in visual basic?

If you are referring to the searching and sorting of strings, there are 2 main methods that Visual Basic uses most. If you want to search for a phrase in a string, you would probably use the InStr method, which would give you an integer which would indicate the place where the phrase was found. It might look something like this:

Dim InputString as String

Dim StringToFind as String = "Whatever text you want to find"

Dim PositionInteger as Integer

PositionInteger = InStr(InputString, StringToFind)

If you wanted to sort the string, you could do it with the substring method using the split point you found with the previous code. To do that, you would make a variable that would contain the latter half of your string, and use the subtring method to extract it from the whold string. To do that, you must type "Substring" and in parenthasis, give it a starting position, and an ending position. If you want all the characters from the phrase to the end of the sting, you do not need to put in an end point. The starting point for this example will be the position of the start of the search phrase, plus thirty (since you want to start after the end of the phrase, which is thirty characters long). Your code might look like this:

Dim NewString as String

NewString = Substring(PositionInteger + 30)

This would make the variable "NewString" contain all the characters following the search phrase.

What are parts of visual basic in toolbox?

There are different parts of IDE- Entegrated development Environmene in visual basic. The important IDE elements are following-

  1. Tool Bar
  2. menu Bar
  3. Project explorer Window
  4. Properties Window
  5. Form designer
  6. Form Layout window
  7. Tool Box
  8. Object Browser

How do you make binary to decimal converter in G W BASIC?

First of all we will talk about how binary number are converted back into decimal representation and later we will have program.

Here is the formula of this transformation:

Binary number: a3a2a1a0

Decimal number a x 23 + a x 22 + a x 21 + a x 20

Example:

Binary: 1101

Decimal: 1 x 23 + 1 x 22 + 0 x 21 + 1 x 20 = 8 + 4 + 0 + 1 = 13

And here we have our program:

#include

#include

#include

int main() {

char str[100];

int ind;

int sum = 0;

printf("Please enter binary number: ");

scanf("%s", str);

for(ind = 0; ind < strlen(str); ind++) {

sum += (str[ind] - 0x30) * pow(2, strlen(str) - ind - 1);

}

printf("Number in decimal would be %d\n", sum);

return 0;

}

Testing:

Please enter binary number: 1101

Number in decimal would be 13

Please enter binary number: 10000001

Number in decimal would be 129

Please enter binary number: 11111111

Number in decimal would be 255

Please enter binary number: 0

Number in decimal would be 0

What is Message Box in VB?

A message box is a predefined function which displays a box containing text, a title, a series of buttons and a small indicative picture to the user informing them of the basic nature of the message (E.g A Critical Exception would have a large red circle with a cross in it). It will return an integer value to its calling procedure to indicate which button the user clicked (e.g. Ok or Cancel).

The code for a message box is structured as follows:

MsgBox(,