SlideShare a Scribd company logo
Q U R R AT - U L - A I N B A B A R
CS114 – Fundamentals of Programming
Overview
Introduction
Course details
Assessment
What is this course about?
Aims and Outcomes
Introduction
 Instructor: Qurrat-ul-ain Babar
 Counseling/Consultation Hours
 During office hours but it will be best if you take an appointment by
email first
 Email: qurrat.ain@seecs.edu.pk
 Office: 115, NIT Building
 Contact No: 051 9085 4015
 Teaching Assistant – Mr. Shahzeb Khan
 Email: shazktk786@gmail.com
 Contact No: 0300-5574001
Introduction
 Brief Introduction of students
 Name
 Qualification
 Day Scholar/ Hostelite
 % in FSc/A-Levels
 Your aim/aspiration in life
C R E D I T S : 2 + 1
Course Details
Course Details
 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
 An introduction to the development of programs using
C++.
 Emphasis is given to the development of program
modules that can function independently.
 Object-oriented design
 The theory of data structures and programming
language design is continued.
What is this course about?
 Problem solving
 Designing solutions using flowcharts
 Basic computer programming using C/C++
 Logic building & algorithms
Text Book
 Book
 There are many books on C/C++
 All of them teach almost the same thing
 Book only teaches you the syntax.
 You must know yourself how to use that syntax.
Text Book
Reference Book
Course Contents
Week Topics
1 Introduction to Course, Introduction to Computer: System components,
networks and operating systems
Lab: Computer Hardware and Operating System
2 Introduction to Logic, Flow Charts, Pseudo Code, Introduction to Programming
Lab: Problem Solving using Flow Charts (Visual Logic), Testing the
Programming Environment and Basic Program
3 Programming Environment, Basic Programming, Statements, Expressions,
Comments
Lab: First Program, Basic statement, and Output Formats
4 First Program, Compilation, Variables, Types, Operators, Debugging
Lab: Variable processing, Arithmetic operations, Finding Errors
5 I/O, interactive programming
Lab: User Input based programming
6 OHT – I
Course Contents
Week Topics
7 Relational operators, logical operators, conditional statements
Lab: Conditional Constructs I
8 If-Else Statement, Switch-Break-Continue
Lab: Conditional Constructs II
9 Iterations, For loop, Do-While Loop, While Loop
Lab: Loops and Iterations
10 Functions, parameters to functions
Lab: Function Definition, Function Parameters and calls
11 More functions, Recursion
Lab: Function reuse and recursion
12 OHT – II
Course Contents
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
By the end of the course, you should be able to:
1. Comprehend the fundamental concepts of computer
systems.
2. Apply programming skills to implement computer-
based solutions of well specified problems.
3. Analyze where computer programs fit in the provision
of computer-based solutions to real world problems.
Ground Rules
Attendance Policy
 Will be marked at the beginning of the class (within first
10 mins)
 75% required to take ESE
 Any missed attendance is your own responsibility
 No late attendance marking
Quiz Policy
 5-6 quizzes in whole semester
 Unannounced
 No drop quiz
Assignment Policy
 3 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
 Each student will submit their own work at the end of
each lab
 No late/email submissions will be accepted
 Zero tolerance for plagiarism/cheating
 Discussing lab task is fine, but you must submit your own work.
 Pop Lab Quiz – which can be unannounced, you should
expect a lab quiz after every 3/4 lab sessions.
Student Civility
 In an effort to make this class enjoyable for everybody…
 Please be on time to class!
 Please do not talk to your friends and neighbors in class! It disturbs
everyone, and makes it hard to concentrate. If you have a question,
just ask me!
 Please turn your cell-phones off! No usage of mobiles during class –
will have a penalty.
 Interaction is the key
 Please ask questions
 If you don’t understand, ask
 Let me know if I am going too slow/too fast
Student Civility
 No room for indecency in this class.
Road Map for Today
• Computer Programming in Civil Engineering
• History of Computers
• Introduction to Computers
• Introduction to Programming
Why study Computer
Programming in Civil Engineering?
HISTORY OF COMPUTERS
Hardware and Software
• Charles Babbage
Creator of the Analytical Engine - the first
general-purpose digital computer (1833)
• ENIAC - the Analytical Engine was not built
until 1945 (Harvard Mark I)
– World’s first programmable computer
– Could carryout any calculation
– CPU was 8 feet tall , 100 feet long and
weighed 30 tons
(courtesy of US Army Historic Computer
Images)
(courtesy : Wikipedia.org)
History of Computers
• Ada (1815-52)
Wrote a program for computing the
Bernoulli’s sequence on the Analytical
Engine - world’s 1st computer program
INTRODUCTION TO
COMPUTERS
A device that can
perform
computations and
make logical
decisions
Motherboard
Input
devices
Processing
devices
Quratulain Shafi
Memory
devices
RAM:
Volatile memory
ROM:
Non-volatile
memory
Storage
devices
IDE - Integrated
Drive Electronics
Magnetic storage:
Hard disks
Non-volatile memory
SCSI - Small Computer
Systems Interface
Storage
devices
Optical storage:
CD/ DVD
Non-volatile memory
Output
devices
Communication
devices
System
Software
Name some other Operating
Systems
Application
Software
A Layered View of the Computer
Machine with all its hardware
System Software
Compilers, Interpreters, Preprocessors, etc.
Operating System, Device Drivers
Application Programs
Word-Processors, Spreadsheets,
Database Software, IDEs,
etc…
Can computers think?
Even the most powerful
supercomputers require
human interaction!
1. Setting up the system
2. Installing software
3. Running programs
4. Managing files
5. Maintaining the system
Commonly used
Programming languages
Microsoft
.Net
Basic
C++
Perl
C Pytho
n
Pascal
Cobol
• 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 not easy to learn 
C
C++
We teach C++, Why?
• We will be using DevC++ 4.9.9.2
• Full-featured Integrated Development Environment
(IDE)
• Home task:
– Download and install DevC++ on your PCs from:
http://www.bloodshed.net/dev/devcpp.html
DevC++
INTRODUCTION TO
PROGRAMMING
Computer has to
be precisely told
what it needs to
do; otherwise
• Programs are everywhere on the computer and
internet
Program
• Even operating systems are
programs
“a precise sequence of steps to solve a
particular problem”
Program
• Programs are run or executed (like OS runs on
Hardware like laptop or cell phone)
• Programs can also be run by other programs (like
when we play games in a web browser)
Program design
Source Code
Hierarchy chart
Flow chart
Pseudo Code
Machine Code
Program
Designing
Program coding
Source Code
Hierarchy chart
Flow chart
Pseudo Code
Machine Code
Hierarchy Chart
Program design
2 ways to show details:
i) Pseudocode: describes logic and processing
flow in human-language statements
ii) Flow chart: graphically represents logic flow.
Most projects use both methods
Program design
Problem Solving
Problem
A shepherd's son is helping his father build a pen for their
sheep. The pen will be 24m long and 20m wide, and have
fence posts 4m apart. How many fence post does he
need?
Problem
Mr. Qutb‐ud‐din is arranging a dinner party for his friends
in a large room. 22 people are invited. He has to borrow
square tables, that can seat 1 person on each side. He
wants to arrange tables in a rectangular shape so that
they look like 1 large table. What is the smallest number
of tables that he needs?
Problem Solving
 Understand the Problem
 Knowledge of the problem, its domain, & details
 Devising the Plan
 Thinking of possible solutions
 Carrying out the Plan
 Create retraceable steps
 Looking Back
 Compare solution to problem. Improve.
Fence Problem Solution
 Understand
 Rectangle
 Length of sides 24x20m
 Posts 4 meters apart
 Number of posts?
 Plan
 Drawing a diagram may help
 Start from corner posts perhaps
Fence Problem Solution
 Solve
 Draw rectangle
 Show sides to scale
 Place corner posts
 Place posts 4 meters apart
 Count posts
 Look Back
 Can you solve it in a better way?
Dinner Party Problem Solution
 Understand
 Squares tables, 1 person on each side
 Form a large rectangle
 22 people
 Putting them together will reduce the number of people on each
square table
 Plan
 Drawing pictures of different arrangements may help
 Few possibilities: 1 single row, 2 rows perhaps
Dinner Party Problem Solution
 Carry out the Plan
 Single row: 2 people at each, with 3 people at end tables
 Double Row: 1 person at each, with 2 people at corner tables
Dinner Party Problem Solution
 Looking Back
 Single row configuration will be best, given the room is long
enough to hold it.
 What if the number of people is increased to 38?
Another Problem
I say a number between 1 and 70.
If the number is less than 30, you say “Too Young”,
otherwise say “Too Old”.
What happened there?!
 Understand
 Too simple
 Plan
 Too simple
 Carry out the Plan
 Too simple
 Looking Back
 Why too simple?
Human Intelligence
 A very general mental capability that, among other
things, involves the ability to reason, plan, solve
problems, think abstractly, comprehend complex ideas,
learn quickly and learn from experience.
 Can you understand this definition?
 Why were you able to find answer for 38 people in
dinner party?
Machines
 Are machines intelligent?
They need instructions
• Accurate
• In order
New Problem
Take the problem “ I say a number between 1 and 70. If the
number is less than 30, you say “Too Young”, otherwise say “Too
Old”. ” and provide a solution so that a machine could do the same
what you did.
 Understand, Plan, Solve, Look back.
Representing your solution
 There are 2 ways to represent
 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
 Pseudo Code can be generic or language specific
 Works as a planning tool
 Clarifies the algorithm flow of information
 Makes it easier to generate language syntax
Flow Chart
 Same as a pseudo code but graphical
 Easier to read and understand
 Specific symbols to represent different programming constructs
Flow Chart Symbols
 Flow charts are used in many domain, hence have numerous
symbols
 Some basic are:
Flow Chart Symbols
Flow Chart Example
PROCESS
Program design
START
STOP
INPUT
OUTPUT
CONNECTOR
FLOW LINES
STOP
inputCent
centigrade
calcFah
fahrenheit = (1.8*centigrade) + 32
outputFah
fahrenheit
STARTConvert
Centigrade to
Fahrenheit
PSEUDOCODE:
Display “Enter Centigrade: "
Input centigrade
fahrenheit = 1.8 * centigrade + 32
Display “Centigrade to Fahrenheit = " fahrenheit
• 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 ]
Lec 01   introduction

More Related Content

Similar to Lec 01 introduction

Learn to Code with MIT App Inventor ( PDFDrive ).pdf
Learn to Code with MIT App Inventor ( PDFDrive ).pdfLearn to Code with MIT App Inventor ( PDFDrive ).pdf
Learn to Code with MIT App Inventor ( PDFDrive ).pdf
NemoPalleschi
 
Programming of c++
Programming of c++Programming of c++
Programming of c++
Ateeq Sindhu
 
Lecture01 0089
Lecture01 0089Lecture01 0089
Lecture01 0089
ZUbaria Inayat
 
01 introduction to cpp
01   introduction to cpp01   introduction to cpp
01 introduction to cpp
Manzoor ALam
 
Intro. to prog. c++
Intro. to prog. c++Intro. to prog. c++
Intro. to prog. c++
KurdGul
 
[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP
Muhammad Hammad Waseem
 
Java basics
Java basicsJava basics
Java basics
Hoang Nguyen
 
lecture_1.pptx
lecture_1.pptxlecture_1.pptx
lecture_1.pptx
GargTutorials
 
Blue Prism Training Agenda
Blue Prism Training AgendaBlue Prism Training Agenda
Blue Prism Training Agenda
Saranya Vempalli
 
Unit no_1.pptx
Unit no_1.pptxUnit no_1.pptx
Unit no_1.pptx
Ganeshpatil499846
 
1-Lec - Introduction and Course Objectives.ppt
1-Lec - Introduction and Course Objectives.ppt1-Lec - Introduction and Course Objectives.ppt
1-Lec - Introduction and Course Objectives.ppt
AqeelAbbas51
 
Write code and find a job
Write code and find a jobWrite code and find a job
Write code and find a job
Yung-Yu Chen
 
1. course introduction
1. course introduction1. course introduction
1. course introduction
Saeed Parsa
 
Administrative
AdministrativeAdministrative
Administrative
Soran University
 
Soft Eng 1st PPT
Soft Eng 1st PPTSoft Eng 1st PPT
Soft Eng 1st PPT
Carlo Miguel Arca
 
OpenSubmit - How to grade 1200 code submissions
OpenSubmit - How to grade 1200 code submissionsOpenSubmit - How to grade 1200 code submissions
OpenSubmit - How to grade 1200 code submissions
Peter Tröger
 
CS Education for All. A new wave of opportunity
CS Education for All. A new wave of opportunityCS Education for All. A new wave of opportunity
CS Education for All. A new wave of opportunity
Peter Donaldson
 

Similar to Lec 01 introduction (20)

Learn to Code with MIT App Inventor ( PDFDrive ).pdf
Learn to Code with MIT App Inventor ( PDFDrive ).pdfLearn to Code with MIT App Inventor ( PDFDrive ).pdf
Learn to Code with MIT App Inventor ( PDFDrive ).pdf
 
Lecture1.ppt
Lecture1.pptLecture1.ppt
Lecture1.ppt
 
Programming of c++
Programming of c++Programming of c++
Programming of c++
 
Lecture01 0089
Lecture01 0089Lecture01 0089
Lecture01 0089
 
01 introduction to cpp
01   introduction to cpp01   introduction to cpp
01 introduction to cpp
 
Intro. to prog. c++
Intro. to prog. c++Intro. to prog. c++
Intro. to prog. c++
 
[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP
 
Java basics
Java basicsJava basics
Java basics
 
lecture_1.pptx
lecture_1.pptxlecture_1.pptx
lecture_1.pptx
 
Blue Prism Training Agenda
Blue Prism Training AgendaBlue Prism Training Agenda
Blue Prism Training Agenda
 
Unit no_1.pptx
Unit no_1.pptxUnit no_1.pptx
Unit no_1.pptx
 
1-Lec - Introduction and Course Objectives.ppt
1-Lec - Introduction and Course Objectives.ppt1-Lec - Introduction and Course Objectives.ppt
1-Lec - Introduction and Course Objectives.ppt
 
Write code and find a job
Write code and find a jobWrite code and find a job
Write code and find a job
 
1. course introduction
1. course introduction1. course introduction
1. course introduction
 
Administrative
AdministrativeAdministrative
Administrative
 
Soft Eng 1st PPT
Soft Eng 1st PPTSoft Eng 1st PPT
Soft Eng 1st PPT
 
OpenSubmit - How to grade 1200 code submissions
OpenSubmit - How to grade 1200 code submissionsOpenSubmit - How to grade 1200 code submissions
OpenSubmit - How to grade 1200 code submissions
 
Lecture 1 (bce-7)
Lecture   1 (bce-7)Lecture   1 (bce-7)
Lecture 1 (bce-7)
 
CS Education for All. A new wave of opportunity
CS Education for All. A new wave of opportunityCS Education for All. A new wave of opportunity
CS Education for All. A new wave of opportunity
 
III-1ece.pdf
III-1ece.pdfIII-1ece.pdf
III-1ece.pdf
 

Recently uploaded

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 

Recently uploaded (20)

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 

Lec 01 introduction

  • 1. Q U R R AT - U L - A I N B A B A R CS114 – Fundamentals of Programming
  • 2. Overview Introduction Course details Assessment What is this course about? Aims and Outcomes
  • 3. Introduction  Instructor: Qurrat-ul-ain Babar  Counseling/Consultation Hours  During office hours but it will be best if you take an appointment by email first  Email: qurrat.ain@seecs.edu.pk  Office: 115, NIT Building  Contact No: 051 9085 4015  Teaching Assistant – Mr. Shahzeb Khan  Email: shazktk786@gmail.com  Contact No: 0300-5574001
  • 4. Introduction  Brief Introduction of students  Name  Qualification  Day Scholar/ Hostelite  % in FSc/A-Levels  Your aim/aspiration in life
  • 5. C R E D I T S : 2 + 1 Course Details
  • 6. Course Details  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%
  • 7. Course Description  An introduction to the development of programs using C++.  Emphasis is given to the development of program modules that can function independently.  Object-oriented design  The theory of data structures and programming language design is continued.
  • 8. What is this course about?  Problem solving  Designing solutions using flowcharts  Basic computer programming using C/C++  Logic building & algorithms
  • 9. Text Book  Book  There are many books on C/C++  All of them teach almost the same thing  Book only teaches you the syntax.  You must know yourself how to use that syntax.
  • 12. Course Contents Week Topics 1 Introduction to Course, Introduction to Computer: System components, networks and operating systems Lab: Computer Hardware and Operating System 2 Introduction to Logic, Flow Charts, Pseudo Code, Introduction to Programming Lab: Problem Solving using Flow Charts (Visual Logic), Testing the Programming Environment and Basic Program 3 Programming Environment, Basic Programming, Statements, Expressions, Comments Lab: First Program, Basic statement, and Output Formats 4 First Program, Compilation, Variables, Types, Operators, Debugging Lab: Variable processing, Arithmetic operations, Finding Errors 5 I/O, interactive programming Lab: User Input based programming 6 OHT – I
  • 13. Course Contents Week Topics 7 Relational operators, logical operators, conditional statements Lab: Conditional Constructs I 8 If-Else Statement, Switch-Break-Continue Lab: Conditional Constructs II 9 Iterations, For loop, Do-While Loop, While Loop Lab: Loops and Iterations 10 Functions, parameters to functions Lab: Function Definition, Function Parameters and calls 11 More functions, Recursion Lab: Function reuse and recursion 12 OHT – II
  • 14. Course Contents 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
  • 15. Course Outcomes By the end of the course, you should be able to: 1. Comprehend the fundamental concepts of computer systems. 2. Apply programming skills to implement computer- based solutions of well specified problems. 3. Analyze where computer programs fit in the provision of computer-based solutions to real world problems.
  • 17. Attendance Policy  Will be marked at the beginning of the class (within first 10 mins)  75% required to take ESE  Any missed attendance is your own responsibility  No late attendance marking
  • 18. Quiz Policy  5-6 quizzes in whole semester  Unannounced  No drop quiz
  • 19. Assignment Policy  3 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.
  • 20. Lab Tasks Policy  Each student will submit their own work at the end of each lab  No late/email submissions will be accepted  Zero tolerance for plagiarism/cheating  Discussing lab task is fine, but you must submit your own work.  Pop Lab Quiz – which can be unannounced, you should expect a lab quiz after every 3/4 lab sessions.
  • 21. Student Civility  In an effort to make this class enjoyable for everybody…  Please be on time to class!  Please do not talk to your friends and neighbors in class! It disturbs everyone, and makes it hard to concentrate. If you have a question, just ask me!  Please turn your cell-phones off! No usage of mobiles during class – will have a penalty.  Interaction is the key  Please ask questions  If you don’t understand, ask  Let me know if I am going too slow/too fast
  • 22. Student Civility  No room for indecency in this class.
  • 23.
  • 24. Road Map for Today • Computer Programming in Civil Engineering • History of Computers • Introduction to Computers • Introduction to Programming
  • 25. Why study Computer Programming in Civil Engineering?
  • 27.
  • 28. Hardware and Software • Charles Babbage Creator of the Analytical Engine - the first general-purpose digital computer (1833) • ENIAC - the Analytical Engine was not built until 1945 (Harvard Mark I) – World’s first programmable computer – Could carryout any calculation – CPU was 8 feet tall , 100 feet long and weighed 30 tons (courtesy of US Army Historic Computer Images) (courtesy : Wikipedia.org)
  • 29. History of Computers • Ada (1815-52) Wrote a program for computing the Bernoulli’s sequence on the Analytical Engine - world’s 1st computer program
  • 30. INTRODUCTION TO COMPUTERS A device that can perform computations and make logical decisions
  • 31.
  • 32.
  • 37. Storage devices IDE - Integrated Drive Electronics Magnetic storage: Hard disks Non-volatile memory SCSI - Small Computer Systems Interface
  • 41.
  • 42. System Software Name some other Operating Systems
  • 44. A Layered View of the Computer Machine with all its hardware System Software Compilers, Interpreters, Preprocessors, etc. Operating System, Device Drivers Application Programs Word-Processors, Spreadsheets, Database Software, IDEs, etc…
  • 45. Can computers think? Even the most powerful supercomputers require human interaction!
  • 46. 1. Setting up the system 2. Installing software 3. Running programs 4. Managing files 5. Maintaining the system
  • 48. • 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 not easy to learn  C C++ We teach C++, Why?
  • 49. • We will be using DevC++ 4.9.9.2 • Full-featured Integrated Development Environment (IDE) • Home task: – Download and install DevC++ on your PCs from: http://www.bloodshed.net/dev/devcpp.html DevC++
  • 50. INTRODUCTION TO PROGRAMMING Computer has to be precisely told what it needs to do; otherwise
  • 51. • Programs are everywhere on the computer and internet Program • Even operating systems are programs
  • 52. “a precise sequence of steps to solve a particular problem” Program • Programs are run or executed (like OS runs on Hardware like laptop or cell phone) • Programs can also be run by other programs (like when we play games in a web browser)
  • 53. Program design Source Code Hierarchy chart Flow chart Pseudo Code Machine Code Program Designing
  • 54. Program coding Source Code Hierarchy chart Flow chart Pseudo Code Machine Code
  • 56. 2 ways to show details: i) Pseudocode: describes logic and processing flow in human-language statements ii) Flow chart: graphically represents logic flow. Most projects use both methods Program design
  • 58. Problem A shepherd's son is helping his father build a pen for their sheep. The pen will be 24m long and 20m wide, and have fence posts 4m apart. How many fence post does he need?
  • 59. Problem Mr. Qutb‐ud‐din is arranging a dinner party for his friends in a large room. 22 people are invited. He has to borrow square tables, that can seat 1 person on each side. He wants to arrange tables in a rectangular shape so that they look like 1 large table. What is the smallest number of tables that he needs?
  • 60. Problem Solving  Understand the Problem  Knowledge of the problem, its domain, & details  Devising the Plan  Thinking of possible solutions  Carrying out the Plan  Create retraceable steps  Looking Back  Compare solution to problem. Improve.
  • 61. Fence Problem Solution  Understand  Rectangle  Length of sides 24x20m  Posts 4 meters apart  Number of posts?  Plan  Drawing a diagram may help  Start from corner posts perhaps
  • 62. Fence Problem Solution  Solve  Draw rectangle  Show sides to scale  Place corner posts  Place posts 4 meters apart  Count posts  Look Back  Can you solve it in a better way?
  • 63. Dinner Party Problem Solution  Understand  Squares tables, 1 person on each side  Form a large rectangle  22 people  Putting them together will reduce the number of people on each square table  Plan  Drawing pictures of different arrangements may help  Few possibilities: 1 single row, 2 rows perhaps
  • 64. Dinner Party Problem Solution  Carry out the Plan  Single row: 2 people at each, with 3 people at end tables  Double Row: 1 person at each, with 2 people at corner tables
  • 65. Dinner Party Problem Solution  Looking Back  Single row configuration will be best, given the room is long enough to hold it.  What if the number of people is increased to 38?
  • 66. Another Problem I say a number between 1 and 70. If the number is less than 30, you say “Too Young”, otherwise say “Too Old”.
  • 67. What happened there?!  Understand  Too simple  Plan  Too simple  Carry out the Plan  Too simple  Looking Back  Why too simple?
  • 68. Human Intelligence  A very general mental capability that, among other things, involves the ability to reason, plan, solve problems, think abstractly, comprehend complex ideas, learn quickly and learn from experience.  Can you understand this definition?  Why were you able to find answer for 38 people in dinner party?
  • 69. Machines  Are machines intelligent? They need instructions • Accurate • In order
  • 70. New Problem Take the problem “ I say a number between 1 and 70. If the number is less than 30, you say “Too Young”, otherwise say “Too Old”. ” and provide a solution so that a machine could do the same what you did.  Understand, Plan, Solve, Look back.
  • 71. Representing your solution  There are 2 ways to represent  Pseudo code  An English‐like representation of logical steps to solve a problem.  Flowchart  Pictorial representation of the same thing.
  • 72. Pseudo Code BEGIN GET number IF number less than 30 THEN Say “Too Young” ELSE Say “Too Old” ENDIF END
  • 73. 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
  • 74. Pseudo Code  Pseudo Code can be generic or language specific  Works as a planning tool  Clarifies the algorithm flow of information  Makes it easier to generate language syntax
  • 75. Flow Chart  Same as a pseudo code but graphical  Easier to read and understand  Specific symbols to represent different programming constructs
  • 76. Flow Chart Symbols  Flow charts are used in many domain, hence have numerous symbols  Some basic are:
  • 79. PROCESS Program design START STOP INPUT OUTPUT CONNECTOR FLOW LINES STOP inputCent centigrade calcFah fahrenheit = (1.8*centigrade) + 32 outputFah fahrenheit STARTConvert Centigrade to Fahrenheit PSEUDOCODE: Display “Enter Centigrade: " Input centigrade fahrenheit = 1.8 * centigrade + 32 Display “Centigrade to Fahrenheit = " fahrenheit
  • 80. • 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 ]