0% found this document useful (0 votes)
12 views44 pages

CH-1 (1)

The document provides an overview of different types of societies, focusing on the Information Society where information handling is key. It explains the components of a computer system, including hardware and software, and outlines the programming process through the Problem Solving Life Cycle. Additionally, it discusses programming languages, compilation, and interpretation, specifically in the context of C++.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views44 pages

CH-1 (1)

The document provides an overview of different types of societies, focusing on the Information Society where information handling is key. It explains the components of a computer system, including hardware and software, and outlines the programming process through the Problem Solving Life Cycle. Additionally, it discusses programming languages, compilation, and interpretation, specifically in the context of C++.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 44

Lecture - 1

NTRODUCTION
Types of society
Types of society

✔ (1.0) Hunting-Gathering society

✔ (2.0) Agrarian and pastoral


society

✔ (3.0) Industrial society

✔ (4.0) Information society

✔ (5.0) ?
Information Society

Information Society : is a term for a society in which the creation,


distribution, and manipulation of information has become the most
significant economic and cultural activity.

Computers Internet
What is computer?

A computer : is a programmable device that is used to input,


store, retrieve, and processes data.
Computer System

 Hardware : different metallic and plastic


parts
 Software : set of instructions
Hardware

ALU CU

CPU

Main Memory

Output Devices

Secondary Memory
Software
 Application software : Programs written to perform particular tasks
for users
 System software : Collection of programs to operate the computer
system
Operating system
 Operating system: The set of system programs used to operate
and control a computer
 Tasks performed by the OS include:
 Memory management
 Allocation of CPU time
 Control of input and output
 Management of secondary storage devices
What is Computer program?

A computer program : is a collection of instructions that perform


a specific task when executed.
Wikipedia Programming : is the process of designing and building an

executable computer Program to accomplish a specific computing result.


Wikipedia
Programming Language

Programming language : is a formal language, which comprises a set of


instructions that produce various kinds of output.
 Programming languages are used in computer programming to
implement algorithms.
 Today there are thousands of high-level programming languages, and
new ones continue to emerge.
Programming Language
Problem Solving Life Cycle
Problem Solving Life Cycle : Also called Software Development
Procedure
 Helps developers understand the problem to be solved and
create an effective, appropriate software solution
 Problem Solving Life Cycle
 Phase 1: Development
 Phase 2: Documentation
 Phase 3: Maintenance
Problem Solving Life Cycle
 Requirement
 Phase 1: Development
 Analysis
 Design
 Coding
 Testing
 Phase 2: Documentation
 Phase 3: Maintenance
Requirement
 Request for a program or statement of a problem
 After a program requirement is received, phase 1 begins.
 In the real world, it is a complex task of extracting and documenting
user requirements
Phase 1: Development
 Step 1: Analyze the Problem
 Determine and understand the output items the program must
produce
 Determine the input items
Phase 1: Development
 Step 2: Develop a Solution
 Select the exact set of steps, called an “algorithm”, to solve the
problem
 Refine the algorithm
 Start with initial solution in the analysis step until you have
an acceptable and complete solution
 Check solution
 ***Read about Pseudo Code & Flowchart
Phase 1: Development
 Step 3: Code the Solution
 Consists of actually writing a C++ program that
corresponds to the solution developed in Step 2
 Program should contain well-defined patterns or structures of the
following types:
 Sequence
 Selection
 Iteration
 Invocation
Phase 1: Development
 Step 3: Code the Solution
 Sequence: Defines the order in which instructions are executed
 Selection: Allows a choice between different operations, based
on some condition
 Iteration: Allows the same operation to be repeated
based on some condition
 Also called looping or repetition
 Invocation: Involves invoking a set of statements when
needed
Phase 1: Development
 Step 4: Test and Correct the Program
 Testing: Method to verify correctness and that requirements are
met
 Bug : A program error
 Debugging : The process of locating an error, and correcting
and verifying the correction
 Testing may reveal errors, but does not guarantee the absence of
errors
Phase II: Documentation
 Five main documents are needed:
 Program description
 Algorithm development and changes
 Well-commented program listing
 Sample test runs
 Users' manual
Phase III: Maintenance
 Ongoing correction of newly discovered bugs
 Revisions to meet changing user needs
 Addition of new features
 Usually the longest phase
 Good documentation vital for effective
maintenance
Low and High Level Languages
 Low-level languages: Languages that use instructions tied directly
to one type of computer
 machine language, assembly language
 High-level languages: Instructions resemble written languages,
such as English
 Can be run on a variety of computer types
 Visual Basic, C, C++, Java
Low and High Level Languages
 Machine language programs : only programs that can actually be
used to operate a computer
 Also referred to as object codes
 Consists of a sequence of instructions composed of binary
numbers
 Contains two parts: an instruction Operation Address
0010 0000 0000 0100
and an address 0100 0000 0000 0101
0011 0000 0000 0110
Low and High Level Languages
Low and High Level Languages
 Assembly language programs: Substitute word-like symbols, such
as ADD, SUB, and MUL, for binary opcodes
 Use decimal numbers and labels for memory addresses
 One-to-one correspondence (Usually, each line of assembly code
produces one machine instruction)
 Example: ADD 1, 2

 Assemblers: Translate programs into machine language


Low and High Level Languages
Low and High Level Languages
 High level language : One-to-many correspondence
 Each statement corresponds to several machine language
instructions
 Much easier to program than in assembly language.
 Data are referenced using descriptive names
 Operations can be described using familiar symbols
 Example:
cost = price + tax
Low and High Level Languages
Low and High Level Languages
Compilation and Interpretation
 Compilers :
 The compiler translates the high-level source program into an
equivalent target program (typically in machine language), and
then goes away.
 All statements are translated and stored as an executable
program, or object program; execution occurs later
 When written to a file in a format understood by the operating
system, machine language is commonly known as object
Compilation and Interpretation
 Compilers :
Compilation and Interpretation
 Interpreters :
 The interpreter reads statements in that language more or less
one at a time, executing them as it goes along.
 In general, interpretation leads to greater flexibility and better
diagnostics (error messages) than does compilation.
 Each statement is translated individually and executed
immediately after translation
Compilation and Interpretation
 Interpreters :
Compilation Process in C++

 Preprocessor : removes comments and white space, expand


abbreviations / macro and groups characters together into tokens
such as keywords, identifiers, numbers, and symbols
Compilation Process in C++
 Linker : Combines your object code with pre-compiled object
libraries for input/output etc.
 Input are the object files (.obj).
 Output is the executable file (.exe) in Windows.

00001111
00110011 00001111
11111111 00110011
00000000 11111111 Linker
11100111 00000000
11100111

Object File
.obj
Executable File
Library Files .exe
.obj
Compilation Process in C++
 Compiler : Translates high-level language to machine language.
 Input to a compiler is the source code
 Output from the compiler is the object code (.obj).
Source Code
 The programs written in a high or low-level language
 It is written by the programmer.
 Can be compiled automatically into object code or machine code or
executed by an interpreter.
 C++ source programs have extension ‘.cpp’ or ‘.h’
General Notes on C++
 C++ is immensely popular
 particularly for applications that require speed and/or access to
some low-level features.
 It was created in 1979 by Bjarne Stroustrup
 at first as a set of extensions to the
C programming language.
END
Of
Lecture -
1

You might also like