Today we will see in this post What is a Program and What is Programming Language Basics Of Small Basic And Basic Of Programming Language, What is a Program?, Starting a New Basics Of Small Basic Program, Opening a Basics Of Small Basic Program, Executing a Basics Of Small Basic Program, Creating a Basics Of Small Basic Program, Some Rules of Basics Of Small Basic Programming, constants, variables, Rules for naming variables, Types of Variables, in easy and understandable English language. Guys, I hope it will be the best beneficial and enjoyable concept for all.
Small Basic has been developed by Microsoft Corporation. It is one of the many versions of BASIC programming language.
BASIC stands for Beginner’s All-purpose Symbolic Instruction Code Small Basic has a user-friendly screen and is meant to teach programming to beginners. The language is simple and easy to learn. You can start writing simple programs in no time.
- 1 What is a Program?
- 2 Basics Of Small Basic
- 3 Starting a New Basics Of Small Basic Program
- 4 Opening a Basics Of Small Basic Program
- 5 Executing a Basics Of Small Basic Program
- 6 Creating a Basics Of Small Basic Program
- 7 Some Rules Basics of Small Basic Of Programming Language
A program is a set of instructions for the computer to perform a particular task. A program is also called a piece of code. It instructs the computer what to do and how to do it. A line in a program is called a statement and every statement instructs the computer to do something.
Basics Of Small Basic
Once you have installed Small Basic on your system, you can start it by clicking Start Microsoft Small Basic or by double-clicking the Small Basic icon available on the desktop .
This screen has all the tools required for programming Here, you can write the program code, run it and debug it. To debug a program means to check for and remove errors in the program, if any.
Starting a New Basics Of Small Basic Program
To start writing a new program in Small Basic, click in the editor pane and start typing, If, by chance, you don’t see the Editor pane, click the New button in the File group on the toolbar. A blank editor will appear.
Opening a Basics Of Small Basic Program
To open an already saved Small Basic program, the steps are as given below:
Click the Open button in the File group. The Open dialog box appears. Select the drive and the folder, select the file, and click the Open button.
saving a Small Basic Program
After you have created a program in Small Basic, you can save it following the steps given below:
1. There are two buttons in the toolbar to save the program-Save and Save As .
2.When you click the Save button for the first time, the Save As dialog box will appear
3, Select the drive and then the folder where you want to save your program.
4 Type the name of the program in the File name text box and click the Save button. A file is created with the file name extension.sb.
Now, when you make changes to his program, clicking the Save button will automatically save the modified program with the same name in the same folder
If you want to save the modified program with a different name, use the Save As button.
If you try to exit Small Basic by clicking the close button without saving the program, Small Basic will pop-up a message box prompting you to save the program discard the changes Or cancel the message box.
Executing a Basics Of Small Basic Program
After writing a program, you would like to execute or run t to see its output. The steps for doing this are:
1. Click the Run button in the Program group on the toolbar.
2. The output of the program appears. To close the output window and return to the program, press any key or click the Close button on the upper-right corner of the window,
Creating a Basics Of Small Basic Program
Let us now write a simple program in Small Basic.
In the editor pane, notice that line number 1 is already present
As you type the code, a popup list . This is due to a feature called intellisense.
It helps you insert a command correctly. You can move through the list using the UP/DOWN
arrow keys and make a selection by pressing the Enter key
Type the first line of code and press the Enter key. Line number 2 appears automatically. Similarly, you will get line numbers 3, 4, and so on, as you go on typing the next lines of code.
Notice how the help area provides useful information Figure S6 shows the help area displaying an explanation about the WriteLine command.
Now, execute the program by clicking the Run button. The output appears in the output
Type in a name and press the Enter key. The
message (as shown in the program output) will appear. To return to the main window, press any key on the keyboard.
Some Rules Basics of Small Basic Of Programming Language
While programming Small Basic, you should remember the following points:
- A keyword is a reserved word, which means it cannot be used for any other purpose. All computer languages have a specific set of keywords. Small Basic has 14 keywords
- All keywords must be spelled correctly. For example, if you type WriteLine instead of WriteLine, an error occurs.
- Small Basic is not case-sensitive. It does not differentiate between upper and lower case letters. This means WriteLine and writeLine are the same. But it is a good practice to follow preferred case styles in programming.
- Small Basic ignores spaces in the code. However, spaces help to make the code readable.
Constants are the data or values that cannot be changed in a program. Based on the type of data stored, a constant can be of numeric or string type.
Numeric constant A numeric constant includes the digits 0-9 with or without a decimal Ain’t. It can be a positive or a negative number. Addition, subtraction, multiplication, and division operations can be performed on such constants. For example, 1234, 56.43, and -12.6 dre a few numeric constants.
String constant A string constant is a sequence of characters belonging to the Small Basic character set, for example “I am in class 6”. Every computer language uses digits, characters, and special symbols that form its character set. A string constant can include numbers, letters, or special characters enclosed within double quotes. For example, “This is a string constant!”, “123 Punjabi Bagh”, and 4919899555555′ are a few string constants.
A program generally works on data, i.e. number, text, date, or picture. This data has to be stored in the computer’s memory so that it can be changed or read during program execution, A variable is an area in a computer’s memory that has a name and that stores data temporarily, This means that you can change the data in the variable during program execution. Can you guess the variable used in the program in Figures? Yes, it is Name and it stores the value Manisha
Rules for Naming Variables
You should keep the following rules in mind while naming variables:
- A variable name can only include letters, numbers, and the underscore character.
- The first character must be a letter.
- The variable name cannot be a reserved word of Small Basic.
- Some suggestions to write a variable name properly
- If a variable name consists of more than one word, the words should be joined together using an uppercase letter or an underscore character.
- Variable names should be meaningful, i.e., it should indicate the data stored in the variable. For example, StudentName, TotalMarks, and Emp_ Salary.
Types of Variables
Depending on the type of data stored in them, variables are of different types. The two main types of variables and their sub-types in Small Basic are:
• Numeric type This type of variable is used to store numbers that can be used in calculations. This variable type can be further divided into:
1. Integer type It is used to store a whole number (non-decimal number). Examples of such numbers are 56, -87, and 32450.
2.Floating type It is used to store fractional numbers (number with a decimal point). Examples of such numbers are 45.67, -187.23, and 3,1415.
String type This type of variable is used to store a list of characters. It can be a name, a string of numbers, a sentence, or a paragraph. A string is always enclosed within double quotes. A few examples are “Small Basic Program”, “GUI”, and “23456746794”.