PIR MEHR ALI SHAH ARID AGRICULTURE UNIVERSITY
University Institute of Information Technology
Programming Fundamentals (CS-323)
Credit Hours: 4(3-3) Prerequisites: None
Teacher: Nergis Gulzar Office: R-105
Abbasi
Course Learning Outcomes (CLOs)
At the end of course the students will be able to: Domain BT Level*
1. Understand basic problem solving steps and logic C 2
constructs
2. Apply basic programing concepts C 3
3. Design and implement algorithms to solve real world C 3
problems.
*BT- Bloom’s Taxonomy, C=Cognitive domain, P=Psychomotor domain, A=Affective
domain
Course Contents:
Introduction to problem solving, a brief review of Von-Neumann architecture,
Introduction to programming, role of compiler and linker, introduction to algorithms,
basic data types and variables, input/output constructs, arithmetic, comparison and
logical operators, conditional statements and execution flow for conditional statements,
repetitive statements and execution flow for repetitive statements, lists and their
memory organization, multi-dimensional lists, introduction to modular programming,
function definition and calling, stack rolling and unrolling, string and string operations,
pointers/references, static and dynamic memory allocation, File I/O operations
Course Objective:
To explore the logic of programming via the algorithm concepts and implement
them in programming structures including functions, arrays, strings, and
pointers.
To develop the program in C++ language, dry run and test it, debug it (fix errors
if any).
To develop an insight of modular and generic programming using functions and
structures.
To implement input/output (I/O) functionality to read from and write to text files
and understand I/O streams
Teaching Methodology:
Lectures, Written Assignments, Practical labs, Semester Project, Presentations
Courses Assessment:
Mid Exam, Home Assignments, Quizzes, Project, Presentations, Final Exam
Reference Materials:
1. Object Oriented Programming in C++ by Robert Lafore
2. Starting out with Python, 4th Edition, Tony Gaddis.
3. Starting out with Programming Logic & Degins, 4th Edition, Tony Gaddis,
4. The C Programming Language, 2nd Edition by Brian W. Kernighan, Dennis M.
Ritchie
5. Introduction to Computation and Programming Using Python: With Application to
Understanding Data, 2nd Edition by Guttag, John
6. Practice of Computing Using Python, 3rd Edition by William Punch & Richard
Enbody
7. C How to Program, 7th Edition by Paul Deitel & Harvey Deitel
8. Problem Solving and Program Design in C++, 7th Edition by Jeri R. Hanly & Elliot B.
Koffman
Week/Lecture # Theory Practical
Introduction to problem Lab Contents can be
Lecture-I solving, a brief review of Von- updated time to time.
Neumann architecture:
Lecture-II Introduction to programming
Lecture-III C++ Basic Compilation
Lab1: C++ Compilers,
Practical-I
Week 1 Programming & Debugging
Getting started with C++
Practical-II language environment, Phases
of C++ program
Program editing, compiling,
Practical-III
executing and debugging
Role of compiler and linker:
Lecture-I
C++ Basic Program Structure
Introduction to algorithms:
Lecture-II Program Statements
Directives
Week 2 Comments
Lecture-III
Namespaces
C++ first program for the
Practical-I
practice of directives.
C++ program for the practice
Practical-II
of comments & namespaces.
Practical-III How to compile and execute.
Week 3 Basic data types and
Lecture-I variables:
Real World Data &Data Types
Lecture-II Variables & Constants
Lecture-III Input/output constructs:
Lab2: Variables and
Practical-I
constants for data storage
Programming Exercises for
Practical-II use of different primitive data
types
Programming Exercises for
Practical-III
use of input/output constructs
Arithmetic, comparison and
Lecture-I logical operators:
Operators
Lecture-II Expression
Lecture-III Precedence & Associativity
Lab3: Practicing with Arithmetic,
Week 4 Practical-I comparison and logical
operators
Writing programs that solve
Practical-II various Boolean and Arithmetic
expressions.
Writing programs that handle
Practical-III
precedence & Associativity.
Conditional statements and
execution flow for
conditional statements:
Lecture-I Conditional Statements
Conditional Operators for
Statements
If Statements
Lecture-II
If-else Statements
Nested if-else Statements
Week 5 Lecture-III
Switch Statements
Lab4: Decision Control
Practical-I
Structures and Statements
Writing programs that use if
else, nested if-else structure like
Practical-II
Comparing digits using if-else
structure.
Writing programs that find out
Practical-III largest digit using nested if
structure
Week 6 Lecture-I Repetitive statements and
execution flow for repetitive
statements:
Loop
For loop
While Loop
Lecture-II
Do while loop
Lecture-III Nested loop
Lab5: Practicing different types of
Practical-I
loops
Writing programs which use for,
Practical-II
while and do while loops.
Writing programs which use
Practical-III Switch, break, continue
statements
Lists and their memory
organization:
Lecture-I
Goto statement
Exit & Continue
Lists and their memory
Lecture-II organization:
Array Fundamentals
Array operations, Searching,
Week 7 Lecture-III
Sorting
Lab6: Arrays, practicing with
Practical-I
loops
Searching array elements using
binary search algorithm.
Practical-II
Sorting array elements using
bubble sort algorithm
Practical-III Practicing goto and exit
Week 8 Multi-dimensional lists,
introduction to modular
Lecture-I programming:
Character Array
Dynamic Array
Lecture-II Multidimensional Array
Introducing Built-in functions
Lecture-III
for array
Lab7: Practicing Multi-
dimensional Arrays.
Practical-I Finding maximum and minimum
elements from multi-dimensional
array
Practical-II Addition of 2D Matrices
Strings using multi-dimensional
Practical-III
character arrays
Midterm Exam
Introducing Abstract Data Type Formation of Groups and
Project Allocation
Defining Structures
Lecture-I Declaring Structure Variables
Initializing and Accessing
Members of structures
Arrays of Structure
Lecture-II Using Nested Structure
Initializing Nested Structure
Union
Lecture-III
Enumeration
Lab8: Structures in C++
Writing programs that input data
into members of structure and
then print data from the
Week 9 Practical-I
members of structure.
Writing programs that copy one
structure variable to another
variable.
Writing programs that swap two
structure type variables, Print
the results before and after
Practical-II
swapping.
Writing programs that define
structure within a structure.
Writing program that defines
variables of type enum, initialize
Practical-III them, apply arithmetic and
comparison operators and
examine output
Week 10 Lecture-I Function definition and
calling:
Scope of variable
Introduction to Functions
Declaring, calling and Defining
Function
Passing arguments (constant &
Variable) to a function
Pass by value & Pass by ref.
Lecture-II Returning value from
function
Stack rolling and unrolling:
Lecture-III optimize the execution time
remove or reduce iterations
Lab9: Functions (Call by value
and reference)
Practical-I Writing programs, which divide
the previously implemented
codes into functions.
Writing programs in which
arguments (constants, variables
Practical-II
and arrays) are passed to
functions.
Writing programs in which
arguments (constants, variables
Practical-III
and arrays) are passed to
functions.
String and string operations:
Lecture-I
String header file
Lecture-II String functions
Lecture-III String functions
Lab10: Implementation of
Week 11 cstring and its functions
Practical-I
Practical Exercises related to
string and their functions
Practical Exercises related to
Practical-II
string and their functions
Program for the verification of
Practical-III
username and password
Week 12 Pointers/references:
Computer Memory
Pointer Basics.
Lecture-I
Pointer variables and its
initialization
Void type pointer
Pointers and Arrays
Lecture-II
Pointers and Strings
Lecture-III Passing & Returning array to a
function
Passing & Returning structure
to a function
Passing & Returning pointer to
a function
Lab11: Implementation of
Pointers
Practical-I Writing programs that print the
memory address of variables
through their pointer variables.
Writing programs that input
Practical-II data into an array and then print
data using pointer notation.
Writing programs that find out
the maximum/minimum value in
Practical-III
an array through pointer
notation.
Week 13 Static and dynamic memory
Lecture-I
allocation:
Lecture-II Function overloading
Lecture-III Recursion, Inline functions
Lab12: Static and Dynamic
Memory Allocation
Writing program that passes
structure as an argument to
Practical-I function.
Writing program that passes
structure by reference as an
argument to function.
Writing program that return
structure from a function.
Practical-II Writing program to swap two
values by passing pointers to
function.
Writing program to find out the
length of a string using pointers.
Writing program to copy one
string to another string using
pointers.
Practicing programs which
define overloaded function call
them and examine output.
Calculating integer powers of a
variable using recursive approach
Calculating factorial of a number
using recursive approach
Practical-III Calculating Fibonacci series using
recursive approach
Writing programs which define
local, global and static variables
& their scope.
File I/O operations
Lecture-I Data Files and Streams
Reading from a file
Lecture-II Adding data to the end of file
Lecture-III Removing and Renaming file
Lab13: File handling in C++
Week 14 Writing program which read and
Practical-I
write file using ifstream and
ofstream.
Writing program which copies
Practical-II contents from one file to other
file using ifstream and ofstream
Writing programs that use
Practical-III
different file operation modes.
Object Oriented Paradigm:
Lecture-I Introduction to Classes and
Objects
Lecture-II Project Demos
Lecture-III Project Demos
Week 15 Practical-I Project Demos
Practical-II Project Demos
Lab14: Implementing
concepts of Classes and
Practical-III
Objects
Lecture-I Course Revision
Lecture-II Course Revision
Lecture-III Course Revision
Week 16
Practical-I Labs Revision
Practical-II Labs Revision
Practical-III Labs Revision
Final term Exam