.

Monday, April 1, 2019

Microsoft Visual Basic Programming Language Computer Science Essay

Microsoft Visual Basic Programming expression Computer Science EssayMicrosoft Visual Basic is a excogitateing speech is which is easier and simpler to use than other computer programming languages for example Java, Programming in C, programming in C++. Visual basic is an ideal language for developing Windows-based, Database and Internet applications. Windows-based applications are event driven and they need well-behaved graphical user interface (GUI) support. Internet applications require web rogue programming support. Visual Basic provides a scripting language called VBScript to help you pull wires and make your web pages interactive. Visual Basic can also be used to access database scored using database management software (DBMS) such as Access 2000, SQL Server 7.5 and FoxPro. Visual Basic also supports both handwritinged-down procedure-oriented programming and the newer object-oriented programming (OOP).Visual Basic is one of the members of a conclave of software call ed Visual studio. The other members of this group are Visual Studio Tools, Visual C++, Visual J++, Visual FoxPro and Visual InterDev. on that point are four versions of Visual BasicWorking Model, Learning Edition, professed(prenominal) Edition and Enterprise Edition.The Visual Basic environment is where users can create and test their cats. The Visual Basic environment consists of several windows such asThe Title bar- displays the projects name(Project1). The scorn project name is Project1. Subsequent projects are named Project2, Project3, and so on Besides the project name, the title bar also contains several icons. The spillages on to the right are the standard windows buttons that can use to minimize, restore or close the window.Menu Bar- has the usual menu items such as File, Edit, View, Project, actuate and Tools.Tool Bar- contains several icons, each of which wagers a reign over. These icons provide a cutoff to the most frequently used commands.Toolbox- Located at th e left hand side of the of the main window, contains a set of icons, each of which represent dictation object or just control.Form window- The window at the focus of the main screen is the Form window. This is where the user can design their application. When the user begins a project, Visual Basic gives a new form with the default form named Form1.These are the few items and tool featured in a Visual Basic environment.Question 1Write a program to produce the future(a) output chief(prenominal) MenuFor Loop go LoopSelect your Choice 1 utilize For Loop to pompousness the pattern122333Do you want to dwell(Y/N)? YMain MenuFor LoopWhile LoopSelect your Choice 2Using epoch Loop to let out the pattern122333Do you want to continue(Y/N)? NPress any key to continue output signal For Question 1Module Module1Sub Main() dusky i, j As Int32DoDim a As IntegerConsole.WriteLine(Main Menu)Console.WriteLine(1-For Loop)Console.WriteLine(2-While Loop)Console.WriteLine(Select Your Choice)a = Conso le.ReadLine()If a = 1 ThenDim k As Int32 = 1Console.WriteLine(Using For Loop to Display the pattern)For i = 1 To 3Console.WriteLine()For j = 1 To iConsole.Write(k.ToString)Next jk += 1Next iDim b As CharConsole.WriteLine(vbCrLf)Console.WriteLine(Do You Want To Continue (Y/N)?)b = Console.ReadLine()If (b = Y) ThenElse obliterate cease IfElseIf (a = 2) ThenConsole.WriteLine(Using While Loop to Display the pattern)Console.WriteLine(vbCrLf)Dim recurrence As Integer = 1While counter Console.WriteLine(StrDup(counter, CChar(counter.ToString)))counter += 1End WhileDim b As CharConsole.WriteLine(vbCrLf)Console.WriteLine(Do You Want To Continue (Y/N)?)b = Console.ReadLine()If (b = N) ThenEndEnd IfElseConsole.WriteLine(Please key 1/2)End IfLoopEnd SubEnd ModuleSource Code For QuestionFor the first interrogative mood was through using if else statements to determine wheter to mark out for circle or mend loop by assigning conditions, for example a=1 for for loop and a=2 for while loop. The v ariable a is set with Dim As Integer meaning as assigned with 1 and 2.The for and while loop figures are above whitin the codition. For the Looping of the statement was done by using Do loop, that the Menu can loop again. Using Console.WriteLine to print the output and using Console.ReadLine for input, Console.WriteLine(vbCrLf) for new line.Dim Char is to represent a single character in this case either using Y or N option to continue with the program. Dim Integer to represent military issue without decimal place.Question 2The names of calories burned per min cycling, jogging, and swimming are 200, 475, and 275, respectively. A person loses 1 pound of metric weight unit for each 3500 calories burned. Write a program that allows the user to input the number of hours spent at each activity and then calculates the number of pounds worked off.The Output For Question 2The pursuance image above is my output for movement 2. This was done using Microsoft Visual.NET 2003. Briefly expl aining the element used to create this was Label, text, Radiobuttons and a button. So this was to test the number of hours that the user has done using the following 3 choices above. So after the selection of one of the radiobuttons the output leave be displayed in pounds, as where the number of pounds shed by the user. The following interaction was done by the button. The codes are set in the button so when the user click the result is displayed. For more detailed story of the code is below.The codes for the button for Question 2Using Dim as Double enables the user to have decimal places compared to integer/ Using 3 variables a, b, and c respectively to represent each of following hours cycling, jogging and swimming. Using the if statements to achieve the result for the corresponding activities for each. The raddiobuttons are the following activities that represents cycling, jogging and swimming. The set of each is multiplied by the value given by the question as 200,475 and 275 and then each of them are divide by the number of calories which is 3500.ConclusionA Visual Basic application or project typically requires some input, processing and output. For interaction with the user the project forget typically use several controls such as forms, text and portray boxes, labels and command buttons. Using these control, the user can control the program execution. supplying a Visual Basic project basically involves the following stairsPlan the project. This involves determining what to do.Designing the User Interface. The interface is the most indubitable part of the project. It is used to interact with the system. The user can determine the controls ( e.g., command buttons, text boxes, labels) that are needed to enter data (input), to display results of computer science (output), and to control the program execution (processing).Set the properties of the controls. Determine the controls that the user impart need or their project and set the properties (e.g ., appearance, name, caption, color) for each of the controls used.Write the code (program). The code represents the action that must take when the user clicks on a Command button. Clicking a Command button is called an event and the code represents a response to that eventTest and debug the code. This is done to ensure that the program works correctlyThese locomote help the user to analyze first, plan using draft and then apply his information gathered into motion. These steps are a require that every programmer must do in order to achieve full satisfaction of their program.

No comments:

Post a Comment