INTRODUCTION TO PROGRAMMING Lecture No. 1 and 2 Combined Lahore Leads University 21 st October 2013
Dec 27, 2015
DEFINITION OF A COMPUTER
Computer is an advanced Electronic Device that takes raw data as input from the user and processes these data under the control of set of instructions (Called Programs) and gives the result (output) and saves the output for the future use.
TYPES OF PERSONAL COMPUTERS
Six Primary Types of Computers are;
1. Desktop Computers2. Workstations3. Notebook Computers4. Tablet Computers5. Handheld Computers6. Smart Phones
OVERVIEW
What is Programming?
Why Programming is Important?
What Skills are Needed?
Develop a Basic Recipe for writing programs
Points to Remember
WHAT IS PROGRAMMING?
As this course is titled as “Introduction to Programming” therefore it is most essential and appropriate to understand what programming really means.
The Definition of a Program is “A Program is a precise sequence of steps”
That reflects to the point that when we say that we have a program, it actually means that we know about a complete set of activities to be performed in particular order.
The purpose of these activities is to solve a problem that can be complex.
WHY PROGRAMMING IS IMPORTANT
Well Programming is very important because of so many reasons;
As a CS and IT professionals one must have a broader vision and perspective
We cant think like a clerk whose work is just to feed a data.
Think about robots, they are programmed, Nuclear Plants they are programmed.
Programming is not just only writing a program it is a process that involves critical reading, analytical thinking and creative synthesis
WHAT SKILLS ARE NEEDED?
Programming is an important activity as people life and living depends on the programs one make.
One should;1. Paying attention to detail2. Think about reusability3. Think about interface4. Understand the fact that computers
are stupid5. Comment the code liberally
HOW TO PROPERLY DESIGN A PROGRAM
Analyze a problem statement, typically expressed as a word problem
Express its essence, abstractly and with examples
Formulate statements and comments in precise language
Evaluate and revise the activities Pay attention to details
SOFTWARE CATEGORIES
Software is categorized into two main categories;
System Software and Application Software
SYSTEM SOFTWARE
The system software controls the computer.
It communicates with computer’s hardware examples are keyboard, mouse, modem, soundcard etc. and controls different aspects of operations
Sub categories of system software are;1. Operating system2. Device drivers3. utilities
1. OPERATING SYSTEM
An operating system also abbreviated as OS is the program that manages all the other programs in a computer.
It is an integrated collection of routines that service the sequencing and processing of programs by a computer.
An operating system may provide many services such as resource allocation, scheduling, I/O Control and data management.
2. DEVICE DRIVERS
The device driver software is used to communicate between the devices and the computer.
If you go on the Device Manager of your system you will find all the information there.
When we attach new device we need to have the software for that, think about when you want to plug in your hand set to your machine you have to install the driver.
3. UTILITY SOFTWARE
It is a program that performs a very specific task usually related to managing system resources.
You might have noticed the utility of disk compression whenever you write a file and save it to disk.
Compression utilities, defragmentation utilities is another example
APPLICATION SOFTWARE
A Program or Group of Programs designed for end users. For example a program for Accounting, Payroll, Control System, Guided System for planes, GPS (Global Positioning System). Another application software is being used in vehicles which through satellite determines the geographical position of the vehicle
HISTORY OF C LANGUAGE
Developed in Late 60’s and Early 70’s
Early stages it was used to design the operating system and compilers.
Now it is widely used in academiaMany researchers have added
their features to this language. It is an open source platform.
TOOLS OF THE TRADE
As a programmer we need different tools to develop a program.
These tools are also developed by programmers.
1. Editor: First of all we need something to write
the algorithm. 2. Compiler and Interpreter:As we do write the code in English and we
also know that computers don’t know any thing apart 0 and 1. we need a translator for that.
TOOLS FOR THE TRADE CONTINUED
3. Debugger: Another Important tool is Debugger.
Every software programmer must know about it. It is used to correct the logical errors.
4. Linker: Most of the time our program is using
different routines that are stored in different locations. Linker Links all those files to a common place to make it a standalone and executable code. The process is also called linking.
TOOLS FOR TRADE CONTINUED
5. Loader: After a executable program is linked
and saved on a disk and it is ready for execution. We need another process that loads the program into memory, and than instruct the processor to execute the program from the first instruction.
The starting point for every C program is from the main function.