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

Chapter 1

The document outlines the program and course outcomes for a programming course focused on problem solving, detailing skills such as algorithm formulation, program translation in C, and effective communication. It also provides an overview of computer systems, including components like input/output devices, CPU, memory types, and software classifications. Additionally, it emphasizes the importance of system software, particularly operating systems, in managing hardware and software resources.

Uploaded by

pratyush9973
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)
11 views44 pages

Chapter 1

The document outlines the program and course outcomes for a programming course focused on problem solving, detailing skills such as algorithm formulation, program translation in C, and effective communication. It also provides an overview of computer systems, including components like input/output devices, CPU, memory types, and software classifications. Additionally, it emphasizes the importance of system software, particularly operating systems, in managing hardware and software resources.

Uploaded by

pratyush9973
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

Introduction to Programming

for Problem Solving


By:-Dr. SharanPreet Kaur
Program Outcomes of Applied Sciences
Department

1. An ability to apply knowledge of mathematics, science, and engineering.


2. An ability to design and conduct experiments as well as to analyze and interpret
data.
3. An ability to design a system, component, or process to meet desired needs within
realistic constraints such as economic, environment, social, political, ethical, health
and safety.
4. An ability to function on multi-disciplinary teams.
5. An ability to identify, formulates and solves engineering problems.
6. An understanding of professional and ethical responsibility.
7. An ability to communicate effectively.
8. The broad education necessary to understand the impact of engineering solutions in
a
global, economic, environmental, and societal context.
9. Recognition of the need for, and an ability to engage in life-long learning.
10. A knowledge of contemporary issues.
11. An ability to use the techniques, skills, and modern engineering tools necessary or
engineering practice.
Course Outcomes of Programming for
Problem Solving

CO1.To formulate simple algorithms for arithmetic and logical problems.


CO2. To translate the algorithms to programs (in C language).
CO3.To test and execute the programs and correct syntax and logical errors.
CO4. To implement conditional branching, iteration and recursion.
CO5. To decompose a problem into functions and synthesize a complete program
using divide and conquer approach.

CO6. To use arrays, pointers and structures to formulate algorithms and programs.
CO7. To apply programming to solve matrix addition and multiplication problems and
searching and sorting problems.
CO8. To apply programming to solve simple numerical method problems, namely root
finding of function, differentiation of function and simple integration.
Mapping of CO’s with Department
PO’s

Course Outcome (CO) Relevant Program Outcome (PO)


CO1. To formulate simple
PO1: Apply knowledge of mathematics, science,
algorithms for arithmetic and
and engineering.
logical problems.
PO1: Apply knowledge of mathematics, science,
CO2. To translate the algorithms to and engineering.
programs (in C language). PO11: Use modern engineering tools for
practice.
PO2: Design, conduct experiments, and analyze
CO3. To test and execute the
data.
programs and correct syntax and
PO11: Use modern engineering tools for
logical errors.
practice.
PO1: Apply knowledge of mathematics, science,
CO4. To implement conditional and engineering.
branching, iteration, and recursion. PO5: Identify, formulate, and solve engineering
problems.
Mapping of CO’s with Department PO’s

Course Outcome (CO) Relevant Program Outcome (PO)


CO5. To decompose a problem into PO1: Apply knowledge of mathematics, science,
functions and synthesize a complete and engineering.
program using a divide-and-conquer PO5: Identify, formulate, and solve engineering
approach. problems.

CO6. To use arrays, pointers, and PO1: Apply knowledge of mathematics, science,
structures to formulate algorithms and engineering.
and programs. PO11: Use modern engineering tools for practice.

CO7. To apply programming to


PO1: Apply knowledge of mathematics, science,
solve matrix addition and
and engineering.
multiplication problems and
PO2: Design and analyze experiments.
searching and sorting problems.
CO8. To apply programming to
PO1: Apply knowledge of mathematics, science,
solve simple numerical method
and engineering.
problems, namely root finding of a
PO8: Understand the global and societal impact
function, differentiation of a
of solutions.
function, and simple integration.
Books to be referred

• Byron Gottfried, Schaum's Outline of Programming


with C, McGraw-Hill

• E. Balaguruswamy, Programming in ANSI C, Tata


McGraw-Hill

• Brian W. Kernighan and Dennis M. Ritchie, The C


Programming Language, Prentice Hall of India.
Introduction
COMPUTER SYSTEMS
• A Computer is an electronic device that stores, manipulates
and retrieves the data.
• We can also refer computer computes the information
supplied to it and generates data.
• A System is a group of several objects with a process.
• For Example: Educational System involves teacher, students
(objects). Teacher teaches subject to students i.e., teaching
(process).
Components of computer

• Computer system can have objects and process. The following


are the objects of computer System
• a) User ( A person who uses the computer)
• b) Hardware
• c) Software
• Hardware: Hardware of a computer system can be referred as
anything which we can touch and feel. Example : Keyboard
and Mouse. The hardware of a computer system can be
classified as Input Devices(I/P) Processing Devices (CPU)
Output Devices(O/P)
Components of a Computer

• There are basically three


important components of a
computer:
• Input Unit
• Central Processing
Unit(CPU)
• Output Unit
Input Unit
• A computer system's input devices are important because they
allow users to enter commands and data. Keyboards, mice,
scanners, and microphones are numerous examples of input
devices.
• The keyboard is the most commonly utilized input device for
inserting text and queries into a computer system.
• Mice are another common input tool used to move the cursor on a
computer screen.
• Scanners are used for inputting physical documents or images into a
computer system.
• Microphones are used to input audio data into a system for
computing. They can be used for various tasks, including recording
audio for podcasts, participating in video conferences, and creating
voice memos for later use.
CPU
• A computer machine's "brain" is its central processing unit (CPU). It executes the
calculations and commands required for functioning of the computer device.
• The CPU comprises some components: the control unit, the arithmetic logic
unit (ALU), and memory.

• Arithmetic and Logic Unit (ALU): The ALU, as its name suggests performs
mathematical calculations and takes logical decisions. Arithmetic calculations
include addition, subtraction, multiplication and division. Logical decisions
involve the comparison of two data items to see which one is larger or smaller or
equal.
• Arithmetic Logical Unit is the main component of the CPU
• It is the fundamental building block of the CPU.
• Arithmetic and Logical Unit is a digital circuit that is used to perform arithmetic
and logical operations.
CPU: Control Unit
• Control Unit: The Control unit coordinates and controls the data flow in
and out of the CPU, and also controls all the operations of ALU, memory
registers and also input/output units.
• It is also responsible for carrying out all the instructions stored in the
program.
• It decodes the fetched instruction, interprets it and sends control signals
to input/output devices until the required operation is done properly by
ALU and memory.
• The Control Unit is a component of the central processing unit of a
computer that directs the operation of the processor.
• It instructs the computer’s memory, arithmetic and logic unit, and input
and output devices on how to respond to the processor’s instructions.
• In order to execute the instructions, the components of a computer
receive signals from the control unit.
CPU: MEMORY

• Computer memory is just like the human brain. It is used to


store data/information and instructions. It is a data storage unit
or a data storage device where data is to be processed and
instructions required for processing are stored. It can store
both the input and output can be stored here.

Types of Computer Memory


• Primary memory
• Secondary memory
• Cache memory
MEMORY: Primary Memory

• It is also known as the main memory of the computer system. It is


used to store data and programs or instructions during computer
operations. It uses semiconductor technology and hence is
commonly called semiconductor memory.

Primary memory is of two types:

1. RAM (Random Access Memory): It is a volatile memory. Volatile


memory stores information based on the power supply. If the power
supply fails/ interrupted/stopped, all the data and information on this
memory will be lost. RAM is used for booting up or start the
computer. It temporarily stores programs/data which has to be
executed by the processor.
MEMORY: Primary Memory

2. ROM (Read Only Memory): It is a non-volatile memory. Non-


volatile memory stores information even when there is a power
supply failed/ interrupted/stopped.
ROM is used to store information that is used to operate the system.
As its name refers to read-only memory, we can only read the
programs and data that is stored on it.
It contains some electronic fuses that can be programmed for a piece
of specific information. The information stored in the ROM in binary
format. It is also known as permanent memory.
MEMORY: Secondary
Memory
It is also known as auxiliary memory and backup memory. It is a
non-volatile memory and used to store a large amount of data or
information. The data or information stored in secondary memory is
permanent, and it is slower than primary memory. A CPU cannot
access secondary memory directly. The data/information from the
auxiliary memory is first transferred to the main memory, and then
the CPU can access it.
MEMORY: Secondary
Memory
Types of Secondary Memory

1. Magnetic Tapes: Magnetic tape is a long, narrow strip of plastic film with a thin,
magnetic coating on it that is used for magnetic recording. Bits are recorded on tape
as magnetic patches called RECORDS that run along many tracks. Typically, 7 or 9
bits are recorded concurrently. Each track has one read/write head, which allows data
to be recorded and read as a sequence of characters. It can be stopped, started moving
forward or backward, or rewound.

2. Magnetic Disks: A magnetic disk is a circular metal or a plastic plate and these
plates are coated with magnetic material. The disc is used on both sides. Bits are
stored in magnetized surfaces in locations called tracks that run in concentric rings.
Sectors are typically used to break tracks into pieces.

3. Optical Disks: It’s a laser-based storage medium that can be written to and read. It
is reasonably priced and has a long lifespan. The optical disc can be taken out of the
MEMORY: Secondary
Memory
Types of Optical Disks
 CDs or Compact Disks are optically readable media. CDs are the
replacement for the phonograph disc. The main material of the CD is
plastic. The shape of the plastic is circular and one side of the circular
plastic is coated with the reflecting metal coating, usually aluminum.
 DVDs- DVD stands for Digital versatile disk. DVD is a digital optical
disc storage format. DVDs can also be known as “Digital video disc”.
DVD technology allows for the storage of a large amount of data using
digital technology. DVDs can store up to 17 gigabytes, compared to the
storage capacity of a compact disc (CD). DVD-Video became the
dominant form of home video distribution in Japan when it first went on
sale in 1995. It is a highly compact disc. This disc can store enough data
for about 17GB.
MEMORY: Cache Memory
• Cache memory is a small, high-speed storage area in a computer. The
cache is a smaller and faster memory that stores copies of the data from
frequently used main memory locations. There are various independent
caches in a CPU, which store instructions and data.
• The most important use of cache memory is that it is used to reduce the
average time to access data from the main memory.
• The concept of cache works because there exists locality of reference
(the same items or nearby items are more likely to be accessed next) in
processes.
• By storing this information closer to the CPU, cache memory helps
speed up the overall processing time. Cache memory is much faster than
the main memory (RAM). When the CPU needs data, it first checks the
cache. If the data is there, the CPU can access it quickly. If not, it must
fetch the data from the slower main memory.
Output Devices

• Output devices are hardware components of a


computer system that are used to show or send data
from the pc to the user or any other device.
• They enable customers to view and engage with the
information and applications the computer is
processing.
• Speakers, projectors, printers, and monitors are a few
examples of output devices.
Computer Software

• In a computer system, the software is basically a set of


instructions or commands that tell a computer what to do.
• In other words, the software is a computer program that
provides a set of instructions to execute a user’s commands
and tell the computer what to do.
• For example like MS-Word, MS-Excel, PowerPoint, etc.
Types of Software

• It is a collection of data that is given to the computer to


complete a particular task. The chart below describes the types
of software:
System Software
• System software is software that directly operates the computer
hardware and provides the basic functionality to the users as well as
to the other software to operate smoothly.
• In other words, system software basically controls a computer’s
internal functioning and also controls hardware devices such as
monitors, printers, and storage devices, etc.
• It is like an interface between hardware and user applications, it
helps them to communicate with each other because hardware
understands machine language(i.e. 1 or 0) whereas user
applications are work in human-readable languages like English,
Hindi, German, etc. so system software converts the human-
readable language into machine language and vice versa.
Types of System Software
It has three subtypes which are:
Operating System: It is the main program of a computer system. When the computer system
ON it is the first software that loads into the computer’s memory. Basically, it manages all the
resources such as computer memory, CPU, printer, hard disk, etc., and provides an interface
to the user, which helps the user to interact with the computer system. It also provides various
services to other computer software. Examples of operating systems are Linux, Apple
macOS, Microsoft Windows, etc.
Language Processor: As we know that system software converts the human-readable language
into a machine language and vice versa. So, the conversion is done by the language processor.
It converts programs written in high-level programming languages like Java, C, C++, Python,
etc(known as source code), into sets of instructions that are easily readable by
machines(known as object code or machine code).
Device Driver: A device driver is a program or software that controls a device and helps that
device to perform its functions. Every device like a printer, mouse, modem, etc. needs a
driver to connect with the computer system eternally. So, when you connect a new device
with your computer system, first you need to install the driver of that device so that your
operating system knows how to control or manage that device.
Application software
• Software that performs special functions or provides
functions that are much more than the basic operation
of the computer is known as application software.
• Or in other words, application software is designed to
perform a specific task for end-users. It is a product
or a program that is designed only to fulfill end-users’
requirements.
• It includes word processors, spreadsheets, database
management, inventory, payroll programs, etc.
Types of Application Software
There are different types of application software and those are:
1. General Purpose Software: This type of application software is used for a variety of
tasks and it is not limited to performing a specific task only. For example, MS-Word,
MS-Excel, PowerPoint, etc.
2. Customized Software: This type of application software is used or designed to
perform specific tasks or functions or designed for specific organizations. For
example, railway reservation system, airline reservation system, invoice management
system, etc.
3. Utility Software: This type of application software is used to support the computer
infrastructure. It is designed to analyze, configure, optimize and maintains the system,
and take care of its requirements as well. For example, antivirus, disk fragmenter,
memory tester, disk repair, disk cleaners, registry cleaners, disk space analyzer, etc.
Operating System

• An Operating System (OS) is a foundational software that manages a computer's hardware


and software resources while providing services to application programs and users. It acts as
an intermediary, ensuring efficient utilization of resources like CPU, memory, storage, and I/O
devices. Without an OS, users cannot directly communicate with hardware or run applications.
Features:
 Resource Management: Distributes computing resources (CPU, memory, disk) among
processes and users.
 File Management: Organizes data into files and directories, handles file permissions, and
ensures data consistency.
 User Interface: Offers interaction interfaces such as Command-Line Interface (CLI) or
Graphical User Interface (GUI).
 Concurrency: Enables multiple processes or users to work simultaneously (multitasking,
multiprocessing).
 Error Handling: Detects and responds to hardware or software errors during execution.
Compiler
• A compiler is a translator that produces an output of low-level
language (like an assembly or machine language) by taking an
input of high-level language.
• It is basically a computer program used to transform codes
written in a programming language into machine code (human-
readable code to a binary 0 and 1 bits language for a computer
processor to understand).
• The computer then processes the machine code for performing
the corresponding tasks.
• Compilers check all types of errors, limits, and ranges. Thus, it’s
more intelligent.
• The run time of its program is longer, and it occupies more
memory.
Compiler

A Compiler is a system software that translates high-level programming language code


(human-readable instructions) into machine language code (binary format) that the
computer's processor can execute. The translation is done all at once, producing a
standalone executable file.
Detailed Process:
1. Lexical Analysis: Breaks the source code into tokens like keywords, variables, and
symbols.
2. Syntax Analysis: Checks the arrangement of tokens against the language's
grammatical rules.
3. Semantic Analysis: Ensures that the code makes sense logically and is consistent
with the programming language's rules.
4. Intermediate Code Generation: Produces a simplified, platform-independent
representation of the program.
5. Optimization: Refines the code to enhance efficiency and reduce resource usage.
Compiler

6. Machine Code Generation: Converts the intermediate representation into


platform-specific binary code.
7. Error Handling: Detects syntax and semantic errors before the program
runs.
Purpose:
 Converts human-readable code into efficient machine code.
 Allows the development of reusable, optimized applications.
Interpreter
• It is a program that functions for the translation of a
programming language into a comprehensible one.
• It is a computer program used for converting high-
level program statements into machine codes.
• It includes pre-compiled code, source code, and
scripts.
• An interpreter translates only one statement at a time
of the program.
• They create an exe of the programming language
before the program runs.
Interpreter

• An Interpreter is a system software that translates high-level


programming language code into machine code line-by-line or instruction-
by-instruction, executing each command immediately after translation.
Detailed Characteristics:
 Unlike a compiler, it does not produce a standalone executable file.
 Errors are detected and displayed immediately at the point of execution,
which helps in debugging.
 Interpreters are slower than compilers as the translation happens during
runtime.
Interpreter

• An Interpreter is a system software that translates high-level


programming language code into machine code line-by-line or instruction-
by-instruction, executing each command immediately after translation.
Detailed Characteristics:
 Unlike a compiler, it does not produce a standalone executable file.
 Errors are detected and displayed immediately at the point of execution,
which helps in debugging.
 Interpreters are slower than compilers as the translation happens during
runtime.
Compilers vs. Interpreters

• A compiler takes in the entire program and requires a lot of time


to analyze the source code. Whereas the interpreter takes a single
line of code and very little time to analyze it.
• Compiled code runs faster, while interpreted code runs slower.
• A compiler displays all errors after compilation. If your code has
mistakes, it will not compile. But the interpreter displays errors of
each line one by one.
• Interpretation does not replace compilation completely.
• Compilers can contain interpreters for optimization reasons like
faster performance and smaller memory footprint.
Difference Between System
Software and Application Software

System Software Application Software

It is designed to manage the resources It is designed to fulfill the requirements


of the computer system, like memory of the user for performing specific
and process management, etc. tasks.

Written in a low-level language. Written in a high-level language.

Less interactive for the users. More interactive for the users.

Application software is not so


System software plays vital role for the
important for the functioning of the
effective functioning of a system.
system, as it is task specific.

It is independent of the application


It needs system software to run.
software to run.
COMPUTER LANGUAGES

• As among human beings language is a source of communication to each


other, as same in order to communicate with computer system we must
have a language that can be understandable by the computer.
• For the purpose of performing different types of work on the computer
system, we developed different types of computer languages.
• Humans need a language like Hindi, Telugu, English, or any other regional
language or just a body gesture to tell things, express feelings and to
communicate with others.
• Have you ever wondered how we talk to computers? Isn’t it mysterious
and exciting?
Definition of a Computer
Language

• A computer language is a group of instructions that


are used to create computer programs. This is the
brief of computer languages. The main goal is to
achieve human-computer interaction.
Types of computer language
Low Level Language:

• A Low-level computer language includes only 1’s and


0’s. This language was used in Low-level computers.
• A Low-level language is very easily understood by a
computer but hard to understand for Humans.
• Low level languages are designed to interact with
computer hardware, which are categorized into two
types: Machine level language and Assembly level
language.
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.
• Creating a program in a machine-level language is a very
difficult task as it is not easy for the programmers to write the
program in machine instructions.
• It is error-prone as it is not easy to understand, and its
maintenance is also very high.
Assembly Language

• Assembly level language in computer programming


has evolved with the advancements in the machine
language.
• Assembly language uses symbols, which are
popularly known as mnemonics in computer
terminology to write the instructions.
• So, comparatively writing a program in Assembly
language is more understandable to the Human than
Machine Language.
High level language
• The high-level language is a programming language
that allows a programmer to write the programs
which are independent of a particular type of
computer.

• The high-level languages are considered as high-level


because they are closer to human languages than
machine-level languages.
Comparison

You might also like