0% found this document useful (0 votes)
7 views

1

The document outlines the Programming Fundamentals course, including prerequisites, examination policies, attendance requirements, and evaluation criteria. It introduces key concepts such as computer hardware and software, programming languages, and specifically C++. The course aims to develop problem-solving skills in students with little or no prior programming experience, focusing on C++ for solution design and implementation.

Uploaded by

mianijaz188
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)
7 views

1

The document outlines the Programming Fundamentals course, including prerequisites, examination policies, attendance requirements, and evaluation criteria. It introduces key concepts such as computer hardware and software, programming languages, and specifically C++. The course aims to develop problem-solving skills in students with little or no prior programming experience, focusing on C++ for solution design and implementation.

Uploaded by

mianijaz188
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/ 40

Programming Fundamental

Instructor Name: Muhammad Omer Saeed


Lecture-1
Today’s Lecture

 Introduction to Course & Pre-requisite (Background)

 Course Examination Policy (Quizzes, Assignments, Mid Term & Final


Term)

 Course Attendance Policy

 Introduction to computer & Computer Software

 Computer Environments

 Different Programming Languages (Overview)

 C++ - Introduction

 Problem Analysis & Solution Design

2
Course Prerequisite (Background & Objectives)

 Students with little or No prior programming experience

 Understand computational approach to problem solving

 have Good mathematical Skills

 Course Objective:

 aims to provide students problem solving skills

 Enable students to analyze problem and write solutions in C++

3
Course Examination Policy

 Quiz on Due date & Time (no retake for missed one)

 Assignment on Due date and Time (No acceptance after due date & time)

 Either you are Pass or Fail

 25 in Sessional, 25 in Midterm & 50 in Final means

 All excuses and requests for increasing marks

4
Course Attendance Policy

 80 % Attendance required to appear in final examination

5
Recommended Books

 C++ Programming
From Problem Analysis to Program Design
Sixth Edition
D S Malik

 C++ How to Program


Ninth Edition
Paul Deitel & Harvey Deitel

6
Course Evaluation Criteria

 Programming Assignments 5-10 %


(Maximum 02)
Class Participation
(Presentation/Discussion/Non Graded Quizzes Weekly)
 Quizzes 10 – 15%
(Minimum 04)
25%
 Mid Term Examination
 Final Term Examination 50%
 No Compromise on Marks (What you get is actually what you deserve)

7
Programming Fundamentals

8
Introduction to Computer

What is Computer:
 A device that takes the data as input , process it and then return the result
as an information(output).

Input
Data Processing Output
(Data)

 Any calculating device that automate the work.

 A computer is a general purpose device that can be programmed to carry


out a set of arithmetic or logical operations automatically.

9
Introduction to Computer

Components of Computer:
 Computer system made up of two major components

Computer System

Hardware Software

10
Introduction to Computer

Hardware
 Computer hardware is the collection of physical elements that constitutes a
computer system.

 In simple all visible and touchable parts of computer

11
Introduction to Computer

Software:
 Software is a program that enables a computer to perform a specific task, as
opposed to the physical components of the system (hardware).

 Computer software, or simply software is any set of machine-readable


instructions that directs a computer's processor to perform specific
operations.

12
Introduction to Computer

H/W& S/W Relationship


 Nothing useful can be done with the hardware on its own & software can’t
be utilized without hardware

 Both hardware and Software are Complimentary to each other

13
Computer Software

Software Categories

14
Computer Software

System Software
 Operating system is a program that manages interactions between:
 users and hardware;
 users and software;
 hardware and software;
 ... and so much more.

 Device Drivers are Software use to communicate between the devices and
computers.

 Utility Software Perform a very specific task, usually related to managing


system resources e.g. utility compression, defragmentaion
Computer Software

Application Software:
 Application software is a set of one or more programs designed to carry out
operations for a specific application. Application software cannot run on itself
but is dependent on system software to execute.

16
Computer Environment

Personal Computer

17
Computer Environment

Time Sharing Environment

18
Computer Environment

Client/Server Environment

19
Computer Languages

20
Computer Languages

Machine Languages
 Machine code or machine language is a set of instructions executed directly by
a computer's Central Processing Unit (CPU).
 While easily understood by computers, machine languages are almost
impossible for humans to use because they consist entirely of numbers.

21
Computer Languages

Assembly Language
 Low level Language and just one level higher than machine language
 Works directly with microprocessor
 Embedded Systems depends on Assembly language

22
Computer Languages

High Level languages


 language with strong abstraction from the details of the computer
 may use natural language elements
 Easier to use
 making the process of developing a program simpler and more
understandable
 programs written in a high-level language must be translated into
machine language by a compiler or interpreter.

23
C++ - Introduction

24
C++ - Introduction

History of C++
 The C language was developed in late 60’s and early 70’s, in Bell
Laboratories.

 Before this B and BCPL language were invented to write the Operating
system.

 Dennis Ritchie developed a general purpose language, called C


language, by using different features of BCPL and B languages.

25
C++ - Introduction

26
C++ - Introduction

What is IDE?
 An integrated development environment (IDE) or interactive development
environment is a software application that provides comprehensive
facilities to computer programmers for software development.
 Program is created in Editor and stored on Disk.
 C++ program is stored with extension “.cpp”

27
C++ - Introduction

What is Preprocessor?
 The preprocessors are the directives, which give instruction to the
compiler to preprocess the information before actual compilation starts

 All preprocessor directives begin with #, and only white-space characters


may appear before a preprocessor directive on a line. Preprocessor
directives are not C++ statements, so they do not end in a semicolon (;).

 For example
 #include <iostream>
 #define PI 3.14159

28
C++ - Introduction

What is Compiler?
 A compiler is a computer program that processes statements written in a
particular programming language (source code) and turns them into
machine language (object code) that a computer processor uses.

29
C++ - Introduction

Compiler vs. Interpreter


Compiler Interpreter
Takes Entire program as input Takes Single instruction as input

Intermediate Object Code is Generated No Intermediate Object Code is


Generated

Program need not be compiled every Program is translated every time


time

Errors displayed after compilation Errors displayed for every instruction


interpreted (if any)

30
C++ - Introduction

What is Linker?
 a program used with a compiler or assembler to provide links to the
libraries needed for an executable program.
 a program that takes one or more object files generated by a compiler and
combines them into a single executable file, library file, or another object
file.

31
C++ - Introduction

What is Loader?
 a loader is the part of an operating system that is responsible for loading
programs and libraries.
 A loader loads the programs into the main memory from the storage
device.

32
C++ - Introduction

What is Debugger?
 a computer program that assists in the detection and correction of errors in

computer programs.
 used to correct the logical errors
 control our program while it is running
 stop the execution of program at some point and can check the values
in different variables, can change these values etc.

NOTE: VARIABLES WILL BE DISCUSSED IN NEXT LECTURE

33
Programming With the Problem Analysis –
Coding – Execution Cycle
 Programming is process of Problem Solving
 Algorithm – A step by step problem solving process in
which a solution is arrived at in a finite amount of time
 Three Steps in problem solving
1. Analyze the problem
2. Implement the algorithm
3. Maintain the program by using and modifying

34
Programming With the Problem Analysis –
Coding – Execution Cycle

35
Problem Analysis & Solution Design

 Good Problem Analysis produce effective Solution


 Following are the keys to write good program
 Paying attention to detail
 Think about reusability
 Think about user interface
 Think computer is a dump machine
 Comment code library.

36
Problem Analysis & Solution Design

Paying attention to detail


 Always analyzes the problem statement very carefully and in detail
 Don’t conclude result by considering one aspect only
 Pay attention to all the aspects of the problem
 Pay attention to the calculations involved in the program
 Think about the flow of information provided
 Think Logically about the programstatement

37
Problem Analysis & Solution Design

Think about reusability


 always keep in mind that it could be reused at some other time to solve
same kind problem

Think about Interface


 provide an easy to understand and easy to use interface that is self
explanatory.

38
Problem Analysis & Solution Design

Think computer as dump


 Computers are incredibly stupid. They do exactly what you tell them to
do: no more,
 no less-- unlike human beings. Computers can't think by
themselves.
Comment code library
 Always comment the code liberally
 Comment statements do not affect the performance of the program
 Comments are not compiled by the compiler
 No Memory is used
 Comments are used to explain the functionality of certain piece of
code
 Helps other programmers and yourself for understand code at later
stages

39
40

You might also like