Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 28
Computer programming is the process of designing
and developing various computer programs to complete
specific tasks in either application or software or within the computers. The process constitutes many tasks, like analyzing the problem, generating an algorithm to solve it, and then examining the output generated. Computer programming is creating a series of programs to resolve a problem in a computer.
The programming also has another name called "coding"
and the person who writes the code is referred as the Why Is Computer Programming Important? Computer programming is the lifeblood of modern life. Imagine for a moment what would happen if all computers suddenly disappeared tomorrow. No internet. No data. No connection. No convenience. •Over the past few decades, computer programming has played an important role in the development of the modern computer and the information age that we live in today.
•It has allowed us to create new
computer software and systems that make many aspects of our lives easier.
•Computer Programming allows us to
create new internet-based applications and services that make it possible for us Programming Methodology A programming methodology is concerned with: The analysis of a problem by developing algorithms based on modern programming techniques,
Designingprograms in appropriate languages and
Implementation on a suitable platform
Programming Language • As we know, to communicate with a person, we need a specific language, similarly to communicate with computers, programmers also need a language is called Programming language.
• A programming language is a computer
language that is used by programmers (developers) to communicate with computers. It is a set of instructions written in any specific language ( C, C++, Java, Python) to perform a specific task. A programming language is mainly used Types of Programming Language Low-level language The low-level language is a programming language that provides no abstraction from the hardware, and it is represented in 0 or 1 forms, which are the machine instructions. It is very close to writing actual machine instructions, and it deals with a computer's hardware components and constraints.
Low-level languages come in two different
categories:
Machine Language: A language that the
hardware directly interprets. Assembly Language: A language that is Machine-level language The machine-level language is a language that consists of a set of instructions that are in the binary form 0 or 1. As we know that computers can understand only machine instructions, which are in binary digits, i.e., 0 and 1, so the instructions given to the computer can be only in binary codes. Advantages of Machine Language •The machine language, does not need to be translated since it is already written in binary, or 0s and 1s, which the computer system can read and understand. The initial generation of computers makes tremendous use of this language.
•The CPU directly executes the
machine language or low-level instructions. Disadvantages of Machine Language •Difficult to use -The main drawback of machine language is how difficult it is to develop, learn, and execute codes and algorithms.
•Time-consuming - It is pretty time-
consuming to fix flaws and mistakes in codes and programs.
•Machine dependent- The programmer
has to remember the machine code while preparing a program. Only some people can memorize or even write the code.
•Difficult to debug- Checking the
machine Instructions to locate the error and Assembly Language An assembly language is a type of low- level programming language that is intended to communicate directly with a computer’s hardware. Unlike machine language, which consists of binary and hexadecimal characters, assembly languages are designed to be readable by humans. programming languages such as Low-level assembly language are a necessary bridge between the underlying hardware of a computer and the higher-level programming languages—such as Python or JavaScript—in which modern software programs are written. High Level Language A high-level language is a programming language such as C, FORTRAN, or Pascal that enables a programmer to write programs that are more or less independent of a particular type of computer. Such languages are considered high-level because they are closer to human languages. Advantages of a high-level language
•The high-level language is easy to read,
write, and maintain as it is written in English like words.
•The high-level languages are designed to
overcome the limitation of low-level language, i.e., portability. The high-level language is portable; i.e., these languages are machine-independent. Computer Program A program is a set of instructions following the rules of the chosen language. Without programs, computers are useless. A program is like a recipe. It contains a list of ingredients (called variables) and a list of directions (called statements) that tell the computer what to do with the variables. Program is in human readable form need to convert into machine language so computer can understand the instruction.
Theconversion can be done using two
ways: ◦Compile the program (Compiler)
◦Interpret the program(Interpreter)
We generally write a computer program using a high-level language. A high-level language is one that is understandable by us, humans. This is called source code.
However, a computer does not understand
high-level language. It only understands the program written in 0's and 1's in binary, called the machine code.
To convert source code into machine code, we
use either a compiler or an interpreter.
Both compilers and interpreters are used to
convert a program written in a high-level What is a compiler? A compiler is a special program that translates a programming language's source code into machine code, bytecode or another programming language. The source code is typically written in a high- level, human-readable language such as Java or C++. A programmer writes the source code in a code editor or an integrated development environment (IDE) that includes an editor, saving the source code to one or more text files. A compiler that supports the source programming language reads the files, analyzes the code, and translates it into a format Interpreter Vs Compiler Interpreter Compiler Scans the entire program •Translates and execute the and translates it as a whole program line by line into machine code.
•Interpreters usually take
less amount of time to Compilers usually take a analyze the source code. large amount of time to However, the overall analyze the source code. execution time is However, the overall comparatively slower than execution time is compilers. comparatively faster than •Good for fast debugging interpreters. Slow in •Execution time is more debugging. Execution time is less.