CS114 - Fundamentals of Programming
CS114 - Fundamentals of Programming
Overview
Introduction
Course details
Assessment
Qualification
% in FSc/A-Levels
Credits: 2+1
Grade distribution is (67% + 33%)
• Theory – 67%
• Quizzes – 15%
• Assignments – 10%
• OHT-1 – 15%
• OHT-2 – 15%
• ESE – 45%
• Practical – 33%
• Lab Work – 70%
• Lab Project/Exam – 30%
Course Description
Problem solving
Designing solutions using flowcharts
Basic computer programming using C/C++
Python
Logic building & algorithms
Text Book
Book
There are many books on C/C++
Week Topics
1 Introduction to Course, Introduction to Computer: System components,
networks and operating systems
Lab: Computer Hardware and Operating System
Week Topics
13 Arrays
Lab: Arrays and Operations on Arrays
14 Structures
Lab: Structure definition and usage
15 Pointers
Lab: Pointers, Variable Pointer
16 File I/O
Lab: File Handling and Information storage
17 Project demos, Revision
Lab: Project Demos
18 ESE
19 ESE
Course Outcomes
3-4 Assignments
No drop policy
No late/email submissions will be accepted
Zero tolerance for plagiarism/cheating
Discussing homework concepts is fine, but you must submit your
own work.
Lab Tasks Policy
• Ada (1815-52)
Wrote a program for computing the
Bernoulli’s sequence on the Analytical
Engine - world’s 1st computer program
INTRODUCTION TO
COMPUTERS
Quratulain Shafi
Memory
devices
RAM:
Volatile memory
ROM:
Non-volatile
memory
Storage Magnetic storage:
devices Hard disks
Non-volatile memory
2. Installing software
3. Running programs
4. Managing files
5. Maintaining the system
Commonly used
Programming languages
Basic
Microsoft
Pascal
Perl
Cobol
.Net
Python
We teach C++, Why?
• C++ is one of the most popular languages
– C++ (originally C)
• C++ is portable (runs on Windows, Macintosh, Unix,
Mainframes …)
• C++ is widely used in industries
• C++ is easy to learn or not?????
C++
C
DevC++
• We will be using DevC++
• Full-featured Integrated Development Environment
(IDE)
• Home task:
– Download and install DevC++ on your PCs from:
http://www.bloodshed.net/dev/devcpp.html
INTRODUCTION TO
PROGRAMMING
Computer has to
be precisely told
what it needs to
do; otherwise
Program
• Programs are everywhere on the computer and
internet
Program
Flow chart
Designing
Pseudo Code
Flow chart
Pseudo Code
Hierarchy Chart
Program design
Looking Back
Compare solution to problem. Improve.
Problem
Understand
Too simple
Plan
Too simple
Looking Back
Why too simple?
New Problem
Pseudo code
An English-like representation of logical steps to solve a problem.
Flowchart
Pictorial representation of the same thing.
Pseudo Code
BEGIN
GET number
IF number less than 30 THEN
Say “Too Young”
ELSE
Say “Too Old”
ENDIF
END
Corrected Pseudo Code
BEGIN
GET number
IF number greater or equals 1 AND number less or equals 70 THEN
IF number less than 30 THEN
Say “Too Young”
ELSE
Say “Too Old”
ENDIF
ELSE
Say Invalid Input
ENDIF
END
Pseudo Code
Input INPUT
centigrade
OUTPUT calcFah
fahrenheit = 1.8 * centigrade + 32= (1.8*centigrade) + 32
fahrenheit
STOP
• Write pseudo code and draw a flowchart that
will read the two sides of a rectangle (length
and width) and display its area on screen after
calculation. [Area formula: A = L x W ]