Explore BrainMass
Share

Visual Basics 2010 Beginner

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

Please help design a program that demonstrate passing arguments ByVal and then ByRef. Help is needed with the coding.

It is suggested that I create a square function procedure and get an integer from the user then send it ByVal one time and get the result from the procedure and have the main program display the result. Then you can send it ByRef and have the procedure modify the original variable with the result which can be displayed.

© BrainMass Inc. brainmass.com October 25, 2018, 8:13 am ad1c9bdddf
https://brainmass.com/computer-science/graphics/visual-basics-beginner-531681

Solution Preview

See attachments.

Module Module1

'function which calculate squre of a number passed as value
Private Function SquareByVal(ByVal num As Integer) As Integer
num = num * num
Return num
End Function

'function which calculate squre of a number passed as reference
Private Function SquareByRef(ByRef num As Integer) As Integer
num = num * num
Return num

End Function

Sub Main()

Dim displayResultByVal As Integer
Dim displayResultByRef As Integer

'ask user to enter ...

Solution Summary

The solution discusses the visual basics 2010 beginner.

$2.19
See Also This Related BrainMass Solution

Visual Basic is specialized for development of Windows applications. VB is an event driven programming language that was originally released in 1991 with degrees of similarity to Microsoft's QuickBASIC. VB rose to popularity among developers in the mid-1990s due to its visual user interface development tools. Visual Basic is a component ofVisual Studio.NET (Exforsys, 2000).

Visual Basic is specialized for development of Windows applications. VB is an event driven programming language that was originally released in 1991 with degrees of similarity to Microsoft's QuickBASIC. VB rose to popularity among developers in the mid-1990s due to its visual user interface development tools. Visual Basic is a component ofVisual Studio.NET (Exforsys, 2000).

Programmers using Visual Basic can write an application using components supplied withinVisual Basic. VB is a programming language that is used heavily in business programming, competing directly with C++ and JavaScript (Exforsys. 2000). VB was created to allow programmers to easily create GUI (Graphical User Interface) applications while being an easy to learn programming language. VB is also capable of developing more complex applications by combining visually arranged components and controls on a form, using specific attributes and actions of the components and adding functionality through additional lines of code. A programmer will find VB simple in its code, since the programming language provides default attributes and actions defined for its components (Exforsys, 2000).

Visual Basic comparison with other programming languages

Fortran has become popular and widespread because of its unique combination of properties. Its numerical and input/output facilities are almost unrivalled while those for logic and character handling are as good as most other languages (Page, 2001). Fortran is simple enough that you do not need to be a computer specialist to become familiar with it fairly quickly, yet it has features, such as the independent compilation of program units, which allow it to be used on very large applications. Programs written in Fortran are also more portable than those in other major languages. The efficiency of compiled code also tends to be quite high because the language is straight-forward to compile and techniques for handling Fortran have reached a considerable degree of refinement (Page, 2001). Finally, the ease with which existing procedures can be incorporated into new software makes it especially easy to develop new programs out of old ones.

Java language offers many benefits in object orientation programming. Java is used to create small programs, known as "applets," to be embedded in web pages. For instance, a web page using Java could contain an interactive weather map, a live display of subway trains, or a video game, without the need for the web server to do all of the work (Boutell.com, 2008). Java will allow users to write the program once and run it anywhere on the java platform. Another key benefit of Java is its security features. Both the language and the platform were designed from the ground up with security in mind (O'Reilly, 2001). The Java platform allows users to download untrustworthy code over a network and run it in a secure environment in which it cannot do any harm: it cannot infect the host system with a virus, cannot read or write files from the hard drive, and so forth. This capability alone makes the Java platform unique (O'Reilly, 2001).

Perl is a dynamic programming language very similar to C in many respects. It is used most widely in system administration, web site development (especially on the GUI side), and networking tasks. It is known to be a very straight-forward, easy to use programming language (Schneider, 2010.). As a result of Perl being used extensively in web development, it is a very popular language. Many companies, both large and small, use Perl to write CGI (Common Gateway Interface) scripts. These are the scripts that allow web applications to interact with the server (Schneider, 2010.).

Visual Basic (VB)is a simplified way to create a Graphical User Interface that is often found in HTML coding. Instead of using a plethora of complex lines of coding to provide object images and location placement, users can add prebuilt objects into place on the screen. VB is a user friendly model that is an ideal programming tool for beginners and professional web programmers.

View Full Posting Details