Sunday, April 7, 2019

Small Basic and Programming Essay Example for Free

belittled elemental and weapons platformming EssayComputer planming is defined as the process of creating figurer packet using scheduleming vocabularys. Just like we speak and understand English or Spanish or French, calculators fuck understand curriculums written in certain languages. These be c solelyed chopineming languages. In the beginning on that point were fair a hardly a(prenominal) programming languages and they were rightfully easy to learn and comprehend. But as computing machines and software package became more and more sophisticated, programming languages evolved fast, gathering more complex concepts along the way. As a turn up most modern programming languages and their concepts are pretty ch anyenging to grasp by a beginner. This concomitant has started discouraging people from learning or attempting ready reckoner programming. humbled grassroots is a programming language that is designed to make programming extremely easy, approachable and fun for beginners. Small Basics intention is to bring down the barrier and serve as a stepping stone to the amazing world of computer programming.The Small Basic EnvironmentLet us start with a quick introduction to the Small Basic Environment. When you runner launch SmallBasic, you will check a window that looks like the following figure. intention 1 The Small Basic EnvironmentThis is the Small Basic Environment, where well save and run our Small Basic programs. This environment has several distinct elements which are identified by numbers. The Editor, identified by 1 is where we will spare our Small Basic programs. When you open a sample program or a previously deliver program, it will show up on this editor in chief. You ass then modify it and save if for subsequent use. You potful also open and work with more than one program at one time. Each program you are working with will be displayed in a separate editor. The editor that contains the program you are currently work ing with is called the active editor. The Toolbar, identified by 2 is used to issue commands either to the active editor or the environment. Well learn about the various commands in the toolbar as we go. The Surface, identified by 3 is the place where all the editor windows go.Our stolon ProgramNow that you are familiar with the Small Basic Environment, we will go ahead and start programming in it. Like we just noted above, the editor is the place where we write our programs. So lets go ahead and type the following line in the editor. TextWindow.WriteLine(Hello ball)This is our first off Small Basic program. And if you have typed it correctly, you should see something similar to the figure below. attend 2 First ProgramNow that we have typed our new program, lets go ahead and run it to see what happens. We can run our program either by clicking on the Run notwithstandington on the toolbar or by using the shortcut key, F5 on the keyboard. If e precisething goes well, our program should run with the result as shown below.Figure 3 First Program OutputCongratulations You have just written and run the first Small Basic program. A very small and simple program, but nevertheless a big step towards fitting a real computer programmer Now, theres just one more lucubrate to cover before we go on to create bigger programs. We have to understand what just happened what on the nose did we declare the computer and how did the computer know what to do? In the next chapter, well analyze the program we just wrote, so we can gain that understanding.As you typed your first program, you might have noticed that a popup appeared with a list of items (Figure 4). This is called intellisense and it helps you type your program faster. You can traverse that list by pressing the Up/ nap arrow keys, and when you find something you want, you can hit the Enter key to insert the selected item in your program.Figure 4 IntellisenseSaving our programIf you want to close Small Basic an d come back later to work on the program you just typed, you can save the program. It is in fact a veracious practice to save programs from time to time, so that you dont lose information in the casing of an accidental shutdown or a power failure. You can save the current program by either clicking on the save icon on the toolbar or by using the shortcut Ctrl+S (press the S key while holding down the Ctrl key).Chapter 2Understanding Our First ProgramWhat really is a computer program?A program is a set of operating instructions for the computer. These instructions tell the computer precisely what to do, and the computer always follows these instructions. Just like people, computers can only follow instructions if specified in a language they can understand. These are called programming languages. There are very many languages that the computer can understand and Small Basic is one. Imagine a conversation possibility between you and your friend. You and your friends would use mann er of speaking, organized as sentences to convey information back and forth. Similarly, programming languages contain collections of words that can be organized into sentences that convey information to the computer.And programs are basically sets of sentences (sometimes just a few and sometimes many thousands) that together make sense to both the There are many languages that the computer programmer and the computer alike. can understand. Java, C++, Python, VB, etc. are all powerful modern computer languages that Small Basic Programs are used to develop simple to complex software A regular Small Basic program consists of a bunch programs. of rumors. Every line of the program represents a statement and every statement is an instruction for the computer. When we ask the computer to execute a Small Basic program, it conceives the program and reads the first statement. It understands what were trying to say and then executes our instruction. Once its done executing our first stateme nt, it comes back to the program and reads and executes the second line. It continues to do so until it reaches the end of the program. That is when our program finishes.Back to Our First Program here is the first program we wrote TextWindow.WriteLine(Hello World) This is a very simple program that consists of one statement. That statement tells the computer to write a line of text which is Hello World, into the Text Window. It literally translates in the computers mind to Write Hello World You might have already noticed that the statement can in turn be crosscurrent into smaller segments much like sentences can be split into words. In the first statement we have 3 distinct segments a) TextWindow b) WriteLine c) Hello World The dot, parentheses and the quotes are all punctuations that have to be placed at appropriate positions in the statement, for the computer to understand our intent. You might think of the black window that appeared when we ran our first program.That black wind ow is called the TextWindow or sometimes referred to as the Console. That is where the result of this program goes. TextWindow, in our program, is called an object. There are a number of such objects available for us to use in our programs. We can perform several different operations on these objects. Weve already used theWriteLine operation in our program. You might also have noticed that the WriteLine operation is followed by Hello World inside quotes. This text is passed as input Punctuations such as quotes, spaces and to the WriteLine operation, which it then prints parenthesis are very important in a computer out to the user. This is called an input to the program. Based on their position and count, operation. Some operations take one or more they can change the meaning of what is being inputs while others dont take any expressed.Our Second ProgramNow that you have understood our first program, lets go ahead and make it fancier by adding some colors. TextWindow.ForegroundColor = Yellow TextWindow.WriteLine(Hello World)Figure 5 Adding colorizeWhen you run the above program, youll notice that it prints out the same Hello World phrase inside TextWindow, but this time it prints it out in yellow instead of the gray that it did earlier.Figure 6 Hello World in YellowNotice the new statement we added to our original program. It uses a new word, ForegroundColor which we equated to a prise of Yellow. This means weve assigned Yellow to ForegroundColor. Now, the difference between ForegroundColor and the operation WriteLine is that ForegroundColor did not take any inputs nor did it requisite any parenthesis. Instead it was followed by an equals to symbol and a word. We define ForegroundColor as a Property of TextWindow. Here is a list of values that are valid for the ForegroundColor property. Try replacing Yellow with one of these and see the results dont forget the quotes, they are required punctuations.

No comments:

Post a Comment