0% found this document useful (0 votes)
59 views8 pages

Understanding Computer Programs

The document discusses computer programming languages and their role. It defines what a computer program is and explains that programming languages allow humans to give instructions to computers. It describes different levels of programming languages from low-level machine languages to high-level natural languages. The document also outlines the software development life cycle and its key steps like problem definition, program design, coding, testing, documentation, and maintenance. It discusses algorithms and their properties. Finally, it notes some benefits of learning programming at a young age and attributes of good programming languages like simplicity.

Uploaded by

syabseeshoes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views8 pages

Understanding Computer Programs

The document discusses computer programming languages and their role. It defines what a computer program is and explains that programming languages allow humans to give instructions to computers. It describes different levels of programming languages from low-level machine languages to high-level natural languages. The document also outlines the software development life cycle and its key steps like problem definition, program design, coding, testing, documentation, and maintenance. It discusses algorithms and their properties. Finally, it notes some benefits of learning programming at a young age and attributes of good programming languages like simplicity.

Uploaded by

syabseeshoes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Wollo University

Kombolcha Institute of Technology


Computer Languages

CHAPTER ONE: INTRODUCTION


1.1 What Is a Computer Program?
Computers are so widespread in our society because they have three advantages over us humans.
First, computers can store huge amounts of information. Second, they can recall that information
quickly and accurately. Third, computers can perform calculations with lightning speed and
perfect accuracy. A computer cannot do anything without step-by-step instructions from us
telling it what to do. These instructions are called a computer program, and of course are written
by a human, namely a computer programmer. Computer programs enable us to harness the
computer’s tremendous power.

Programming languages are far more understandable to programmers than machine language
because programming languages resemble the structure and syntax of human language, not ones
and zeroes. Additionally, code can be written much faster with programming languages than
machine language because programming languages automate instructions; one programming
language instruction can cover many machine language instructions.

Programming languages are said to be lower or higher, depending on whether they are closer to
the language the computer itself uses(lower, which means 0s and 1s) or to the language that
people use (higher, which means more English like). There are different levels of languages.

1. Machine Languages First-generation Languages


2. Assembly Languages Second-generation Languages
3. Procedural Languages Third-generation Languages
4. Problem-oriented Languages Fourth-generation Languages
5. Natural Languages Fifth-generation Languages

C++ is but one of many programming languages. Other popular programming languages include
Java, C#, and Visual Basic. There are many others. Indeed, new languages are being created all

1
the time. However, all programming languages have essentially the same purpose, which is to
enable a human programmer to give instructions to a computer.

1.2 Software Development Life Cycle


Software development is the process of creating application or others software which satisfies
the end user’s requirements and needs. The process of developing the application software is
called the Software Development Life Cycle (SDLC). Software Development Life Cycle
(SDLC) consists of six steps.
1. Problem Definition / Program Analysis
2. Program Design
3. Coding
4. Testing
5. Documentation
6. Maintenance

1.2.1 Defining the problem


Defining the problem, also known as program analysis, involves the following tasks.
1. Specifying the objectives of the program
2. Specifying the outputs
3. Specifying the input requirements
4. Specifying the processing requirements
5. Evaluating the feasibility of the program
6. Document the program analysis

1.2.2 Program Design


You know you have a problem and have identified it in the program analysis stage. Now, you
need to plan a solution to meet the objectives you have specified. This second phase is called the
program design stage- it consists of designing a solution.

Structured program design is a method of designing a computer program in such a way so as to


minimize the complexity. Among the tool used in this stage are:
 Flowcharts

2
 Pseudocode

Flowchart
One of the most widely used devices for designing programs is the flowchart, which graphically
represents the logic needed to solve a programming problem. A program flowchart represents the
detailed sequence of steps, needed to solve the problem. Program flowcharts are frequently used
to visualize the logic and steps in processing.

Pseudocode
An alternative or a supplement to flowcharts, pseudocode is a narrative rather than a graphical
form of describing structured program logic.

Documenting the Program Design


At the end of the program design stage, a formal document should be prepared to guide the
future users. How long and detailed the document depends on the size and complexity of the
program.

1.2.3 Coding
Writing the program is called coding. In this step, you use the logic you develop in the program
design stage to actually write the program.

Here are some of the qualities of a good program


 It should be easily readable and understandable by the people other than the original
programmer. This is accomplished by including comments within the program.
 It should be efficient, increasing the programmer’s productivity.
 It should not take excessive time to process, or occupy any more computer memory than
necessary.
 It should be reliable, able to work under all reasonable condition, and always get the
correct output.
 It should be able to detect unreasonable or error conditions and indicate them to the
programmer or user without stopping all operations- crashing the system
 It should be easy to maintain and support after installation.

3
1.2.4 Testing the program
Testing means running the program and fixing it if it does nor work, or debugging it (getting the
errors or bugs out) as programmers call it. There are two types of bugs or errors – syntax errors
and logical errors.

A syntax error is a violation of the rules of whatever programming language the programmer is
writing in. A logic error is when the programmer has used an incorrect calculation or left out a
programming procedure. Even if there is logic error, the programs will work, but may fail to
produce correct results.

1.2.5 Documenting the program


Program documentation is a process that starts from the first phase of the development life cycle.
The importance of program documentation is sometimes not fully understood and often program
documentation is done as rush job before the project deadline. Without proper documentation, it
is very difficult for a programmer, even for the original programmer, to update and maintain a
program.

The final document should contain the following information.


 Program analysis document, with a concise statement of the program’s objectives,
outputs, inputs and processing procedures.
 Program design document, with detailed flowcharts and other appropriate diagrams.
 Program verification document, outlining the checking, testing and correction producers
along with a list of test data and results

1.2.6 Maintaining the Program


After the program has been fully tested and has become operational, it typically will require
maintenance to modify or update it. The effort and cost expended on maintenance is 55% - 70%
programming budget.

1.3 Algorithm
Algorithm can be defined as: “A sequence of activities to be processed for getting desired output
from a given input.”

4
1.3.1 Properties of algorithm
1. Finiteness: An algorithm must always terminate after a finite number of steps. It means after
every step one reach closer to solution of the problem and after a finite number of steps
algorithm reaches to an end point.

2. Definiteness: Each step of an algorithm must be precisely defined. It is done by well thought
actions to be performed at each step of the algorithm. Also the actions are defined
unambiguously for each activity in the algorithm.

3. Input: Any operation you perform need some beginning value/quantities associated with
different activities in the operation. So the value/quantities are given to the algorithm before it
begins.

4. Output: One always expects output/result (expected value/quantities) in terms of output from
an algorithm. The result may be obtained at different stages of the algorithm. If some result is
from the intermediate stage of the operation then it is known as intermediate result and result
obtained at the end of algorithm is known as end result. The output is expected value/quantities
always have a specified relation to the inputs.

5. Effectiveness: Algorithms to be developed/written using basic operations.

Role of Programing Languages


A programming language functions at many different levels and has many roles, and should be
evaluated with respect to those levels and roles. Historically, programming languages have had
a limited role, that of writing executable programs.

Studying programming languages will help you be better at your job, make more money, and
be a happier, more fulfilled and more informed citizen, because you'll learn to: Choose the most
appropriate language for a given task. A programming language lets you express
computational tasks in certain ways.

5
Instead, they can use games and apps to help teach them the basics of computer coding. These
benefits of learning programming at a young age helps kids to gain advantages in thinking,
processing and communicating. These skills will later help kids to be innovative, which will
translate into nearly any profession.

Attributes of good Programing Language

There might be many reasons for the success of a language, but one obvious reason is the
characteristics of the language. Several characteristics believed to be important for making a
programming language good are:

Simplicity : A good programming language must be simple and easy to learn and use. It should
provide a programmer with a clear, simple and unified set of concepts, which can be easily
grasped. The overall simplicity of a programming language strongly affects the readability of the
programs written in that language, and programs, which are easier to read and understand, are
also easier to maintain. It is also easy to develop and implement a compiler or an interpreter for a
programming language, which is simple. However, the power needed for the language should not
be sacrificed for simplicity.

Naturalness:- A good language should be natural for the application area, for which it has been
designed. That is, it should provide appropriate operators, data structures, control structures, and
a natural syntax to facilitate the users to code their problem easily and efficiently.

Abstraction:- Abstraction means the ability to define and then use complicated structures or
operations in ways that allow many of the details to be ignored. The degree of abstraction
allowed by a programming language directly effects its writ ability. Object oriented language
support high degree of abstraction. Hence, writing programs in object oriented language is much
easier. Object oriented language also support re usability of program segments due to this
features.

Efficiency :- Programs written in a good programming language are efficiently translated into
machine code, are efficiently executed, and acquire as little space in the memory as possible.
That is a good programming language is supported with a good language translator which gives
due consideration to space and time efficiency.

Structured:- Structured means that the language should have necessary features to allow its
users to write their programs based on the concepts of structured programming. This property of
a moreover, it forces a programmer to look at a problem in a logical way, so that fewer errors are
created while writing a program for the problem.

Compactness :- In a good programming language, programmers should be able to express


intended operations concisely. A verbose language is generally not liked by programmers,
because they need to write too much.

6
Locality :- A good programming language should be such that while writing a programmer
concentrate almost solely on the part of the program around the statement currently being
worked with.

Programming Language Design Issues

 To improve your ability to develop effective algorithms.


 To improve your use of your existing programming language.
 To increase your vocab of useful programming constructs.
 To allow a better choice of programming language.
 To make it easier to learn a new language.
 To make it easier to design a new language.

What is language paradigm?


A programming paradigm is a style, or “way,” of programming. Some languages make it easy
to write in some paradigms but not others. Never use the phrase “programming language
paradigm.” A paradigm is a way of doing something (like programming), not a concrete thing
(like a language).

Common programming paradigms include:-

 imperative:- in which the programmer instructs the machine how to change its state,
o procedural:- which groups instructions into procedures,
o object-oriented:- which groups instructions together with the part of the state
they operate on,
 declarative:- in which the programmer merely declares properties of the desired result,
but not how to compute it
o functional:- in which the desired result is declared as the value of a series of
function applications,
o logic:- in which the desired result is declared as the answer to a question about a
system of facts and rules,
o mathematical:- in which the desired result is declared as the solution of an
optimization problem

Symbolic techniques such as reflection, which allow the program to refer to itself, might also be
considered as a programming paradigm. However, this is compatible with the major paradigms
and thus is not a real paradigm in its own right.

For example, languages that fall into the imperative paradigm have two main features: they
state the order in which operations occur, with constructs that explicitly control that order, and
they allow side effects, in which state can be modified at one point in time, within one unit of
code, and then later read at a different point in time inside a different unit of code. The
communication between the units of code is not explicit. Meanwhile, in object-oriented

7
programming, code is organized into objects that contain state that is only modified by the code
that is part of the object. Most object-oriented languages are also imperative languages. In
contrast, languages that fit the declarative paradigm do not state the order in which to execute
operations. Instead, they supply a number of operations that are available in the system, along
with the conditions under which each is allowed to execute. The implementation of the
language's execution model tracks which operations are free to execute and chooses the order on
its own.
What is C# paradigm ?

C# (pronounced C sharp) is a general-purpose, multi-paradigm programming language


encompassing strong typing, lexically scoped, imperative, declarative, functional, generic,
object-oriented (class-based), and component-oriented programming disciplines.

You might also like