Introduction to Programming language
Introduction to Programming Languages: A Beginner's Guide
The process of program development
The Collection of Programs is called software and the collection of instructions is called programs. Program development is a stepwise process, Before developing a program some steps process we have to take care of some. 1st Step is to understand the user requirement. 2nd step is program analysis, program analysis is during the requirement phase of software development. 3rd step is to Determine the input and output, Problem analysis is done to obtain the user requirements and to determine the input and output of the program. 3rd step is Designing Algorithm, for Solving any problem, and an algorithm is implemented. An algorithm is a sequence of steps that give a method of solving a problem, Algorithm creates the logic of the Program. 4th step is Program code, on The basis of Alogirthem program code is written 5th step is Testing and debugging the program, and Program Testing is performed to make sure that it gives the correct result. 6th step is Program documentation, Proper Documentation of the program should be done so that it is easier to modify or enhance the program whenever required.
Diagram
What is The programming Designing Methods?
Designing Methods are the first step in obtaining a solution to the given problem. The purpose of designing to represent a solution for a system
There are three types of method
- Top Down Design
- Bottom Up Design
- Modular Approach Design
Top Down Design: Every system has several Hierarchies of components. The Top-level component represents the whole system. Top-down design methods start from the top-level components to low-level components(bottom). in this design the system is divided into some major components Then each major component is divided into lower-level components. similar other components are divided into the low-level component.
Bottom-up Design: Bootom-up design is the reverse of the Top-Down approach. it starts from the low-level component to the higher-level components. it first designs the basic components and from these basic components, the higher-level components are designed.
Modular approach: it is better to divide a large system into modules. in terms of programming, modules are logically a well-defined part of the program. each module is a separate part of the program. it is easy to modify a program written with a modular approach because a change in one module doesn't affect other modules of the program. it is also easy to check bugs in the program modules level programming.
What is the programming language?
Before learning any programming language, it's important to know about the various types of languages and their feature.
Programming language classified into two types
- Low-level language
- high-level language
What is Low level programing language
low-level languages are two types
- Machine level language
- assembly level language
Machine level language: The computer can understand only digital signals, which are in binary Digits i.e. 0 and 1. so the instruction given to the computer can be only in binary codes. The machine language consists of instructions that are in binary 0 or 1. computers can understand only machine-level language.
Writing a program in the machine-level language is a difficult task because it is not easy for programmers to write instructions in binary code. A machine-level language program is error-prone and its maintenance is very difficult. Furthermore, Machine language programs are not portable. every Computer has its own machine instructions, so the programs written for one computer are not valid for other computers.
Assembly-level language: The difficulties faced in machine-level language was reduced to some extent by using a modified form of machine-level language called assembly language. in assembly language instruction is given English like Word such as MOVE ADD, SUB, etc. so it is easier to write and understand the assembly programs. since a computer can understand only machine-level language assembly language programs must be translated into machine language. The translator that is used for translating is called an " Assembler"
Although writing a program in assembly language is a bit easier. The programmer has to know all the low details related to the hardware of a computer. in assembly language, data is stored in computer registers and each computer has a different set of registers. Thus the assembly language program is also not portable. since the low-level language are related to the hardware, the execution of the low-level program is faster.
what is High-level programming language
High-level languages are designed keeping in mind the features of portability i.e these languages are machine-independent. these are English-like languages, so it is easy to write and understand the programs of a high-level language, and so the whole attention can be paid to the logic of the problem being solved, for Translating a high-level language
program into machine language, compiler, or interpreter is used. every language has its own compiler or interpreter. some language in this category is Fortran, COBOL, BASIC, pascal, etc.
What the mean of Translators
we know that computers can understand only machine-level language, which is in binary 0 or 1. The code written in any High- Level or low-level language should be translated into machine-level language and translators are used for this purpose. Translators are just computer programs, which accept a program written in a high-level or low-level language and produce an equivalent machine language program as output.
The three types of translators are used
- Assembler
- Compiler
- interpreter
ASSEMBLER: Assembler is used for converting the code of low-level language(assembly language) into machine-level language.
COMPILER: compiler and interpreter are used to convert the code of high-level language into machine language. The high-level program is known as the source program and the corresponding machine language program is known as the object program. Although both compiler and interpreter perform the same task, there is a difference in their working.
The compiler searches all the errors in the program and lists them. if the program is error free then it converts the code of the program into machine code and the program can be executed by separate commands. an interpreter checks the errors of the program statement by statement. after checking one statement, it converts that statement into machine code and then executes that statement. this process continues until the last statement of programs or an erroneous statement occurs.