0% found this document useful (0 votes)
24 views23 pages

CHAPTER 1.1

The document outlines a course on Problem Solving and Program Design, focusing on the fundamentals of computer programming languages and effective problem-solving skills. It covers various programming languages, their history, types, and advantages/disadvantages, emphasizing the development life cycle and techniques for algorithm specification. The course aims to equip students with the ability to communicate and solve problems using different programming tools.

Uploaded by

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

CHAPTER 1.1

The document outlines a course on Problem Solving and Program Design, focusing on the fundamentals of computer programming languages and effective problem-solving skills. It covers various programming languages, their history, types, and advantages/disadvantages, emphasizing the development life cycle and techniques for algorithm specification. The course aims to equip students with the ability to communicate and solve problems using different programming tools.

Uploaded by

dexmon1636
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

DFC10212 / DFC10252

PROBLEM SOLVING
& PROGRAM
DESIGN
CLO1 Explain the fundamentals of computer
programming languages in several scenarios.

CLO2 Demonstrate effective problem-solving skills in oral (communication)


or writting by using different types of programming tools to solve
the given problem.

Demonstrate effective communication skills to solve problem


using different types of programming tools for the given scenarios
SYNOPSIS
PROBLEM SOLVING & PROGRAM DESIGN

Introduces the techniques in problem solving and program


design. The concepts learned in this course can be applied to
many of real life problems which can be solved by writing
computer programs. A multiphase program development life
cycle and two basic phases of problem solving and program
design are emphasize. Problem analysis and the stepwise
specification of the algorithm, pseudo code and flow chart are
also define.
CONTENTS
1 Introduction to Programming Language

2 Problem Solving Methods

3 Fundamentals of Programming Language

4 Basic Programming Code


INTRODUCTION TO
PROGRAMMING
LANGUAGE
1.1 DESCRIBE THE
PROGRAMMING LANGUAGE
CLO1: Explain the fundamentals of computer programming
languages in several scenarios.
1.1.1DESCRIBE THE
PROGRAMMING
LANGUAGE

1.1.1HISTORY OF 1.1.2 TYPES OF PROGRAMMING 1.1.3 GENERATIONS OF


PROGRAMMING LANGUAGES LANGUAGES PROGRAMMING LANGUAGE
AND APPROACHES
1.1.1 HI STORY OF PROGRAMMI NG
LANGUAGES AND APPROACHES
PROGRAMMING LANGUAGE

A set of conventions in which


instructions for the machine are
written.
There are many languages that
allow humans to communicate with
computers

Programming languages can be


used to create programs to control
the behavior of a machine
A coded language used by
progammers to write instructions
that a computer can understand to
do what the programmer (or the
computer user) wants.
EXAMPLE OF
PROGRAMMING
LANGUAGE
HISTORY OF PROGRAMMING
LANGUAGES

The history of
Early programming C ompiler theory led to
programming languages
languages relying on the creation of high-level
spans from
mathematical notation programming languages,
documentation of early
and similarly obscure which use a more
mechanical computers to
syntax. accessible syntax to
modern tools for software
communicate
development.
instructions.
1.1.2 TYPES OF
PROGRAMMING LANGUAGE

Machine Assembly High Level


Language Language Language
MACHINE LANGUAGE

Numerical machine code The only language


is the lowest-level that is directly
representation of
understood by the
computer program or as a
computer.
primitive and hardware-
dependent programming
language

P rogram s today are


A set
written in higher-level
of instructions executed
directly by a computer’s languages or
central processing assem bly language,
unit(CPU). and translated to
executable m achine
code
Machine Language

BIN ARY C O D E
MACHINE LANGUAGE
ADVANTAGES

P rogram of m achine
language run very fast
because no translation
program is required
for the CP U.

DISADVANTAGES

Difficult to program. A programmer has to It is difficult to debug


The programmer has to rem ember a lot of the program
know details of hardware codes to write a
to write program Machine Language
program which results
in program errors. B IN A R Y C O D E
ASSEMBLY LANGUAGE

A low-level sym bolic


Simpler to work with than
code converted by an
machine languages.
assembler.

A mnemonic to
represent each low-level It is a Low-level
machine instruction or language.
operation.

Assembly Language

A SSEM BLY C O DE
ASSEMBLY LANGUAGE
ADVANTAGES
Efficiency of execution as
the machine level
Easier to understand and Easier to correct errors language.Because this is
saves a lot of time and and m odify program one-to-one translator
effort of the between assembly
instructions.
programmer. language program and its
corresponding machine
language program.

DISADVANTAGES

Assembly language is machine


dependent.
A program written for one
computer might not run in other
computers with different
hardware configuration.
Assembly Language

A SSEM BLY C O DE
HIGH LEVEL LANGUAGE

High-level language is P rograms written in a high-


level language must be
closer to human
translated into machine
languages and further
language by a compiler or
from machine languages.
interpreter.

¨A high-level language is a
programming language The first high-level
such as C or Pascal that
enables a programmer to programming
write programs that are languages were
less independent of a designed in the 1950s.
particular type of
computer.

High Level Language

V IS U A L B A S IC
HIGH LEVEL LANGUAGE
ADVANTAGES

M achine independent
High Level languages
Easier to understand
and the error
are human readable as and develop the
detection
instructions are written program logic in High
and correction is
using English like words Level languages.
and phrases. easier.

DISADVANTAGES

Slower execution: Less control: Higher memory usage:


High-level languages are High-level languages High-level languages
generally slower than low- abstract away low-level require more memory than
level languages,as they details and hardware- low-level languages, as they
require more processing specific functions, making use additional functions and
time to convert their code it difficult to optimize code structures to provide more High Level Language
into machine code.
for specific hardware or organization and structure
systems. to code. V IS U A L B A S IC
tEchnology of programming
languagE

01 02 03 04 05
USING VACUM USING USING USING USING ARTIFICIAL
TUBE TRANSISTOR INTERGRATED INTELLIGENCE
M ICROPROCESSOR
CIRCUITE
04

MACHINE ASSEMBLY THIRD GENERATION FOURTH GENERATION FIFTH GENERATION


LANGUAGE LANGUAGE LANGUAGE LANGUAGE LANGUAGE
GENERATIONS OF
PROGRAMMING LANGUAGE

1 FIRST GENERATION
These are low- level languages like machine
language.

2 SECOND GENERATION
These are low- level assembly languages used in kernels and hardware
drives.

3 THIRD GENERATION
These are high-level languages like C, C++ , Java, Visual B asic, and
Java Script.

4 FOURTH GENERATION
These are used mainly in database programming and scripting.
Examples of these languages include Perl, Python, Ruby, SQL, and
Mat Lab( Matrix Laboratory).

5 FIFTH GENERATION
These are the programming languages that have visual tools to
develop a program. Examples of fifth- generation languages include
Mercury, OP S 5 , and Prolog.
GENERATIONS OF
PROGRAMMING LANGUAGE

1 FIRST GENERATION
The first- generation languages are also called machine languages/
1 G language. This language is machine- dependent. The machine
language statements are written in binary code (0 /1 form) because
the computer can understand only binary language.

Advantages :

1.Fast & efficient as statements are directly written in binary


language.

2 . N o translator is required.

Disadvantages :

1. Difficult to learn binary codes.

2.. Difficult to understand – both programs & where the


error occurred.
GENERATIONS OF
PROGRAMMING LANGUAGE

2 SECOND GENERATION
The second- generation languages are also called assembler languages/
2 G languages. Assembly language contains human- readable notations
that can be further converted to machine language using an assembler.

Assembler – converts assembly level instructions to machine- level


instructions.

Programmers can write the code using symbolic instruction codes that
are meaningful abbreviations of mnemonics. It is also known as low- level
language.

Advantages :

1 . It is easier to understand if compared to machine language.


2 . Modifications are easy.
3 . Correction & location of errors are easy.

Disadvantages :

1. Assembler is required.
2. This language i s architecture / machine- dependent, with a
different instruction set for different machines.
GENERATIONS OF
PROGRAMMING LANGUAGE

3 THIRD GENERATION
The third generation is also called procedural language /3 GL.
It consists of the use of a series of English- like words that
humans can understand easily, to write instructions.
It’s also called H igh-Level P rogramming Language.
For execution, a program in this language needs to be translated
into machine language using a Compiler/ Interpreter.
Examples of this type of language are C, PASCAL, FORTRAN,
COBOL, etc.

Advantages :

1. Use of English- l ike words makes i t a human- understandable language.


2. Lesser number of l ines of code as compared to the above 2 languages.
3.Same code can be copied to another machine & executed on that
machine by using compiler-specific to that machine.

Disadvantages :

1. Compiler/ interpreter is needed.


2. Different compilers are needed for different machines.
GENERATIONS OF
PROGRAMMING LANGUAGE

4 FOURTH GENERATION

The fourth- generation language is also called a


non – procedural language/ 4 G L.
It enables users to access the database.
These languages are also human- friendly to understand.
Examples: S Q L, F oxpro, F ocus, etc.

Advantages :

1. Easy to understand & learn.


2.. Les s time is required for application creation.
3.It is les s prone to errors.

Disadvantages :

1. M emory consumption is high.


2. Has poor control over hardware.
3. Less flexible.
GENERATIONS OF
PROGRAMMING LANGUAGE

5 FIFTH GENERATION
The fifth- generation languages are also called 5GL.
It is based on the concept of artificial intelligence.
It uses the concept that rather than solving a problem
algorithmically, an application can be built to solve it
based on some constraints, i.e., we make computers learn
to solve any problem.
Parallel Processing & superconductors are used for this
type of language to make real artificial intelligence.
Examples: PROLOG, LISP, etc.
Advantages :

1. Machines can make decisions.


2. Programmer effort reduces to solve a
problem.
3 . E asier than 3 G L or 4 G L to learn and use.

Disadvantages :

1. Complex and long code.


2. More resources are required & they are expensive
too.

You might also like