Programming
Language
Updated as of SEP 2020
COMPUTER
Copyright © 2014-2020 TestBook Edu Solutions Pvt. Ltd.: All rights reserved
Download Testbook App
Programming Language
• Computer Programming is a set of instructions that helps the developer to perform
certain tasks that return the desired output for the valid inputs.
How Do Computers Work?
• A computer is a machine that processes information and this information can be any
data that is provided by the user through devices such as keyboards, mouse,
scanners, digital cameras, joysticks, and microphones. These devices are
called Input Devices and the information provided is called input.
• The computer requires storage to store this information and the storage is called
Memory.
• Computer Storage or Memory is of Two Types:
1. Primary Memory or RAM (Random Access Memory): This is the internal
storage that is used in the computers and is located on the motherboard.
RAM can be accessed or modified quickly in any order or randomly. The
information that is stored in RAM is lost when the computer is turned off.
2. Secondary Memory or ROM (Read-Only Memory): Information (data)
stored in ROM is read-only, and is stored permanently. The ROM stored
instruction is required to start a computer.
• Processing: Operations done on this information (input data) is called Processing.
The Processing of input is done in the Central Processing Unit which is popularly
known as CPU.
COMPUTER | Programming Language PAGE 2
Download Testbook App
• Output Devices: These are the computer hardware devices that help in converting
information into human-readable form. Some of the output devices include Visual
Display Units (VDU) such as a Monitor, Printer, Graphics Output devices, Plotters,
Speakers, etc.
• A developer can analyse the problem and come up with simple steps to achieve a
solution to this problem, for which he/she uses a programming algorithm. This can
be compared to a recipe for a food item, where ingredients are inputs and finished
delicacy is the output required by the client.
• In the development environment, the products, software, and solutions can be
designed as scenarios, use cases, and data flow diagrams.
• Based on the client’s requirements, the solution required could be desktop, web or
mobile-based
Basic Programming Concepts
Developers should have essential knowledge on the following concepts to become
skilled in Computer Programming:
1. Algorithm: It is a set of steps or instruction statements to be followed to accomplish
specific tasks. A developer can design his algorithm to achieve the desired
output. For Example, a recipe to cook a dessert. The algorithm describes the steps
to be followed for completing a specific task, but it does not say how to achieve any
of the steps.
2. Source code: Source code is the actual text that is used to construct the program
using the language of choice.
For Example, it is mandatory to have the main method in Java and the text used is
as shown below.
public static void main(String arg[ ]) {
//Steps to be performed
}
COMPUTER | Programming Language PAGE 3
Download Testbook App
3. Compiler: Compiler is a software program that helps in converting the source code
into binary code or byte code, also called machine language, that is easy for a
computer to understand, and can be further executed using an interpreter to run the
program.
4. Data Type: Data used in the applications can be of a different type, it can be a
whole number (integer), floating-point (decimal point numbers), characters or
objects. For Example, double currency = 45.86, where double is a data type used
for storing numbers with decimal points.
5. Variable: Variable is a space holder for the value stored in the memory and this
value can be used in the application. For Example, int age = 25, where age is a
variable.
6. Conditionals: Knowledge of how to use a certain condition, such that a set of code
should execute only if a certain condition is true. In case of a false condition, the
program should exit and should not continue the code further.
7. Array: Array is the variable that stores elements of a similar data type. Knowledge
of using an array in coding/programming will be a great benefit.
8. Loop: Loop is used to execute the series of code until the condition is true. For
Example, in Java, loops can be used as for loop, do-while, while loop or enhanced
for loop.
The code for loop is as shown below:
for (int I =0; i<10; i++) {[Link](i); }
9. Function: Functions or methods are used to accomplish a task in programming, a
function can take parameters and process them to get the desired output. Functions
are used to reuse them whenever required at any place repeatedly.
10. Class: Class is like a template that contains state and behaviour, which
corresponding to programming is field and method. In Object-Oriented languages
like Java, everything revolves around Class and Object.
COMPUTER | Programming Language PAGE 4
Download Testbook App
Essentials of a Programming Language
• Just like any other language we use to communicate with others, a programming
language is a special language or a set of instructions to communicate with
computers. Each programming language has a set of rules (like English has
grammar) to follow and it is used to implement the algorithm to produce the desired
output.
Top Computer Programming Languages
The below table enlists the top Computer Programming Languages and their
applications in real life.
Programming
Popularity Practical Applications of Languages
Language
Desktop GUI application (AWT or Swing api), Applets,
online shopping sites, internet banking, jar files for
Java 1
secured file handling, enterprise applications, mobile
applications, gaming software.
Operating Systems, Embedded systems, Database
C 2 management systems, Compiler, gaming and
animation.
Machine learning, Artificial Intelligence, Data analysis,
Python 3
face detection and image recognition Software.
Banking and trading enterprise software, virtual
C++ 4
machines and compilers.
Visual Windows services, controls, control libraries, Web
5
Basic .NET applications, Web services.
Desktop applications like a file explorer, Microsoft office
C# 6 applications like Word, Excel, Web browsers, Adobe
Photoshop.
COMPUTER | Programming Language PAGE 5
Download Testbook App
Programming
Popularity Practical Applications of Languages
Language
Client side and server side validations, DOM handling,
JavaScript 7
developing web elements using jQuery (JS library).
Static and dynamic websites and applications, Server
PHP 8
side scripting.
Querying database, CRUD operations in database
SQL 9 programming, creating a stored procedure, triggers,
database management.
Apple’s OS X, iOS operating system and APIs, Cocoa
Objective – C 10
and Cocoa Touch.
The selection of particular programming languages depends on many factors such as:
1. Targeted Platform and Project/Solution Requirement: Whenever a software
solution provider comes across the requirement, there are many options to choose
an appropriate programming language. For Example, if a user wants the solution to
be on mobile, then Java should be the preferred programming language for Android.
2. Influence of Technical Partners with the Organization: If Oracle is a tech partner
with the company, then it is agreed to implement software marketed by Oracle in the
solution for every project and product developed. If Microsoft is a tech partner with
the company, then ASP can be used as a development framework for building web
pages.
3. Competency of available Resources & Learning Curve: The developers
(resources) should be available and competent to quickly learn the selected
programming language so that they can be productive for the project.
4. Performance: The selected language should be scalable, robust, platform-
independent, and secure and should be efficient in displaying results within the
acceptable time limit.
5. Support from the Community: In the case of open-source programming language,
the acceptance, and popularity for the language as well as online support from the
growing support group should be available.
COMPUTER | Programming Language PAGE 6
Download Testbook App
Types of Computer Programming
Languages
• Computer Programming language can be divided into two types i.e. Low-level
Language, and High-level Language.
Low-level Language
• Hardware dependent
• Difficult to understand
• Low-level Language can be further divided into two categories:
1. Machine Language: Machine dependent, difficult to modify or program, For
Example, every CPU has its machine language. The code written in machine
language is the instructions that the processors use.
2. Assembly Language: Each computer’s microprocessor that is responsible
for arithmetic, logical and control activities needs instructions for
accomplishing such tasks and these instructions are in assembly language.
The use of assembly language is in device drivers, low-level embedded
systems, and real-time systems.
High-level Language
• Independent of hardware
• Their codes are very simple and developers can read, write and debug as they are
similar to English like statements.
• High-level Language can be further divided into three categories:
1. Procedural Language: Code in the procedural language is a sequential step
by step procedure that gives information like what to do and how to do.
Languages such as FORTRAN, COBOL, Basic, C, and Pascal are a few
examples of procedural language.
COMPUTER | Programming Language PAGE 7
Download Testbook App
2. Non-procedural Language: Code in non-procedural language specify what
to do, but does not specify how to do. SQL, Prolog, LISP are a few examples
of non-procedural language.
3. Object-oriented Language: Use of objects in the programming language,
where the code is used to manipulate the data. C++, Java, Ruby, and Python
are a few examples of Object-oriented language.
Basic Operations of a Programming
Environment
• Five basic elements or operations of programming are listed below:
1. Input: Data can be input using the keyboard, touch screen, text editor, etc. For
Example, to book a flight, the user can enter his login credentials and then select a
departure date and return date, the number of seats, starting place and destination
place, Name of Airlines, etc., from desktop, laptop or mobile device.
2. Output: Once authenticated, and upon receiving the request to book the tickets with
the mandatory inputs, a confirmation of booking for the selected date and destination
will be displayed on the screen, and a copy of the tickets and invoice information is
sent to the user’s registered email id and mobile number.
3. Arithmetic: In case of flight booking, update of the number of seats booked and
those seats need some mathematical calculations, further name of the passenger,
no. of seats reserved, date of journey, journey start date, and starting place,
destination place, etc. should be filled into the airlines server database system.
4. Conditional: It is required to test if a condition is satisfied or not, based on the
condition, the program may execute the function with parameters else it will not get
executed.
5. Looping: It is required to repeat /perform the task until the condition holds. Types of
loops can be While loop, Do-while loop, For loop.
COMPUTER | Programming Language PAGE 8
Download Testbook App
For Example,
for (int i = 0; i < 10; i++)
[Link](i);
COMPUTER | Programming Language PAGE 9