SlideShare a Scribd company logo
1 of 35
Programming
Fundamentals
Resource Person:Syed Ans Ali
3/3/2018Programming Fundamental-I
3
Why are you taking cs?
Are these your motivation?
 Because many people take it
 Just a random choice, no particular reasons
 A required course
 I would like to just get a better grade
 I would like to get programming skills and then grades
 More …
I believe your REAL motivation is ...
I take it because I
am interested
See course outline for : Course Objectives, Outcomes, Weekly
Lecture Plan, Assessment, Grading Scheme, Textbooks etc.
Five Tips to Success
9
Try more exercises and more practice
10
Work hard
11
Do the labs and assignments by yourself
12
Be patient with the machine
13
If you really need that, do it quietly ...
3/3/2018Programming Fundamental-I
14
Please don’t go to home with a bundle of
questions in your mind!
Learning Philosophy
 · Lectures provide the first pass at course materials.
They provide preliminary understanding and knowledge.
 · Labs provide a more interactive environment in which
help is available to clarify further understanding of the
course materials. This activity also provides first hand
implementation of problems using C.
 · Assignments provide more complicated exercises to
understand the concepts of the course. Implementation
of a problem re-inforces the concepts of writing a
program in C.
 · Quiz and Examinations test your knowledge of the
course materials covered.
 This course is for you!
 This course will build your strong foundation
for upcoming courses of the degree
 Without the students the university wouldn’t
exist
 If you have questions, or any suggestions,
please let me know
 You can also always ask me questions via e-ma
At: MadihaTariq777@gmail.com
Problem Solving
3/3/2018Programming Fundamentals
18
Background
Hardware, Operating
System and Application
Software
3/3/2018Programming Fundamentals
19
 Five main components
 Input devices
 Allows the user to input data for processing
 Output devices
 To display the output to the monitor or
getting printed copy
 Processor CPU
CU ALU
AU LU
 Main memory
 Memory locations containing the running
program
 Secondary memory
 Permanent record of data often on a disk
Background
Computer Systems
3/3/2018Programming Fundamentals
20
 Processor Typically called the CPU
 Central Processing Unit
 Follows program instructions
 Typical capabilities of CPU include:
add
subtract
multiply
divide
move data from location to location
Background
Computer Systems
3/3/2018Programming Fundamentals
21
 Data:
 Raw facts and figures provided as input to computer
 Information:
 Data After Processing by computer is called information
Computer
Data Information
Background
Data & Information
3/3/2018Programming Fundamentals
22
 A computer program is…
 A set of instructions written in a sequence to solve a particular
task.
 Computer software is …
 The collection of programs used by a computer
 Includes:
• Editors
• Translators
• System Managers
• Operating Systems
• Games etc
Background
Computer Program
3/3/2018Programming Fundamentals
23
 Computer understands Machine Language
 ‘A’ may look like 01000001
 65 may look like 01000001
 An instruction may look like 01000001
 Programming Languages
 Types
 High Level Languages (C, C++, Java, Pascal, Visual Basic,
FORTRAN, COBOL, Lisp, Scheme, Ada)
 Low Level Languages (Assembly Language)
Background
Programming Languages
3/3/2018Programming Fundamentals
24
 High – Level languages
 Resemble human languages
 Are designed to be easy to read and write
 Must be translated to zeros and ones for the CPU
to execute a program
Background
Programming Languages
3/3/2018Programming Fundamentals
25
 Low – Level Languages
 An assembly language command such as
ADD X Y Z
might mean add the values found at x and y
in memory, and store the result in location z.
 Assembly language must be translated to
machine language (zeros and ones)
0110 1001 1010 1011
 The CPU can follow machine language
Background
Programming Languages
3/3/2018Programming Fundamentals
26
 Translate Programming language to
machine language
Code in
Programming
Language
Language Translator
Code in
Machine
Language
Assembler
(Translates low level or assembly language
program into machine code and also check errors)
Compiler
(Translates High level language
program into machine code and also check errors)
Translator Types
Background
Language Translators
3/3/2018Programming Fundamentals
27
 Translate high-level language to machine language
 Source code
 the original program in a high level language
 Object code
 the translated version in machine language
Source Code
(Code in High Level
Language)
Language Translator
Object Code
(Code in Machine
Language)
Background
Source Code and Object Code
3/3/2018Programming Fundamentals
28
#include<stdio.h>
Int main()
{
Printf(“Hello”);
Return 0;
}
C
Compile
r
1011110100101
0101010101010
1111000011100
1010101010101
0101010101011
1100110011000
Background
Language Translators
3/3/2018Programming Fundamental-I
29
Computer
Input
Data
Output
Solution
Information
Problem
Algorithm
Problem Solving
Abstraction
Process of extracting
essential information
about a problem is
called abstraction.
An Algorithm is a
finite set of steps
carried out to solve a
problem.
Or
A sequence of precise
instructions which
leads to a solution.
A set of instructions
written in a sequence,
acc. to algorithm, to
solve a problem is called
program.
3/3/2018Visual Programming
30
 Problem: To develop a software that get two numbers, calculate sum and then displays the result on screen.
 Abstraction
 Algorithm
 1. Start
 2. Input A
 3. Input B
 4. Sum=A+B
 5. Display Sum
 6. En
 Computer Program (Code)
 #include<stdio.h>
 int main()
 {
 int a, b, c;
 printf("Enter two numbers to addn");
 scanf("%d%d",&a,&b);
 c = a + b;
 printf("Sum of entered numbers = %dn",c);
 return 0;
 }
For Example
Compile
and Run
Output
Sum=A+B
What makes a bad program?
 Writing Code without detailed
analysis and design
 Repeating trial and error without
understanding the problem
 Debugging the program line by
line, statement by statement
 Writing tricky and dirty
programs
PROGRAMMER'S
DRINKING SONG!!
100 little bugs in the code,
100 bugs in the code,
fix one bug, compile it again,
101 little bugs in the code.
101 little bugs in the code …
Repeat until BUGS = 0
—The Internet Joke Book
Group Discussions are mandatory for
effective learning!

More Related Content

What's hot

Study techniques of programming in C
Study techniques of programming in CStudy techniques of programming in C
Study techniques of programming in CTushar B Kute
 
Program design and problem solving techniques
Program design and problem solving techniquesProgram design and problem solving techniques
Program design and problem solving techniquesDokka Srinivasu
 
What is algorithm
What is algorithmWhat is algorithm
What is algorithmmshoaib15
 
Programming
ProgrammingProgramming
ProgrammingSyahida
 
Bba110 computer fundamentals
Bba110  computer fundamentalsBba110  computer fundamentals
Bba110 computer fundamentalssmumbahelp
 
CIS110 Computer Programming Design Chapter (7)
CIS110 Computer Programming Design Chapter  (7)CIS110 Computer Programming Design Chapter  (7)
CIS110 Computer Programming Design Chapter (7)Dr. Ahmed Al Zaidy
 
CIS110 Computer Programming Design Chapter (2)
CIS110 Computer Programming Design Chapter  (2)CIS110 Computer Programming Design Chapter  (2)
CIS110 Computer Programming Design Chapter (2)Dr. Ahmed Al Zaidy
 
Introduction to computer_lec_04_fall_2018
Introduction to computer_lec_04_fall_2018Introduction to computer_lec_04_fall_2018
Introduction to computer_lec_04_fall_2018Ramadan Babers, PhD
 
Dev Concepts: Math Concepts in Programming
Dev Concepts: Math Concepts in ProgrammingDev Concepts: Math Concepts in Programming
Dev Concepts: Math Concepts in ProgrammingSvetlin Nakov
 

What's hot (14)

Study techniques of programming in C
Study techniques of programming in CStudy techniques of programming in C
Study techniques of programming in C
 
Program design and problem solving techniques
Program design and problem solving techniquesProgram design and problem solving techniques
Program design and problem solving techniques
 
Programing Fundamental
Programing FundamentalPrograming Fundamental
Programing Fundamental
 
Sample Programs.ppt
Sample Programs.pptSample Programs.ppt
Sample Programs.ppt
 
What is algorithm
What is algorithmWhat is algorithm
What is algorithm
 
Programming
ProgrammingProgramming
Programming
 
Bba110 computer fundamentals
Bba110  computer fundamentalsBba110  computer fundamentals
Bba110 computer fundamentals
 
CIS110 Computer Programming Design Chapter (7)
CIS110 Computer Programming Design Chapter  (7)CIS110 Computer Programming Design Chapter  (7)
CIS110 Computer Programming Design Chapter (7)
 
CIS110 Computer Programming Design Chapter (2)
CIS110 Computer Programming Design Chapter  (2)CIS110 Computer Programming Design Chapter  (2)
CIS110 Computer Programming Design Chapter (2)
 
Syllabus SFS 1009
Syllabus SFS 1009Syllabus SFS 1009
Syllabus SFS 1009
 
Introduction to computer_lec_04_fall_2018
Introduction to computer_lec_04_fall_2018Introduction to computer_lec_04_fall_2018
Introduction to computer_lec_04_fall_2018
 
Lecture 3 spring2018
Lecture 3 spring2018Lecture 3 spring2018
Lecture 3 spring2018
 
Dev Concepts: Math Concepts in Programming
Dev Concepts: Math Concepts in ProgrammingDev Concepts: Math Concepts in Programming
Dev Concepts: Math Concepts in Programming
 
INSTRUCTION SET
INSTRUCTION SETINSTRUCTION SET
INSTRUCTION SET
 

Similar to Into to programming fundamentals (20)

L1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdfL1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdf
 
Chap 1 c++
Chap 1 c++Chap 1 c++
Chap 1 c++
 
Computer programming all chapters
Computer programming all chaptersComputer programming all chapters
Computer programming all chapters
 
Introduction.pptx
Introduction.pptxIntroduction.pptx
Introduction.pptx
 
Beekman5 std ppt_13
Beekman5 std ppt_13Beekman5 std ppt_13
Beekman5 std ppt_13
 
Software development slides
Software development slidesSoftware development slides
Software development slides
 
10tait
10tait10tait
10tait
 
Chapter 10
Chapter 10 Chapter 10
Chapter 10
 
01 Programming Fundamentals.pptx
01 Programming Fundamentals.pptx01 Programming Fundamentals.pptx
01 Programming Fundamentals.pptx
 
Programming Theory
Programming TheoryProgramming Theory
Programming Theory
 
chapter1-161229182113 (1).pdf
chapter1-161229182113 (1).pdfchapter1-161229182113 (1).pdf
chapter1-161229182113 (1).pdf
 
Savitch Ch 01
Savitch Ch 01Savitch Ch 01
Savitch Ch 01
 
Computer and programing basics.pptx
Computer and programing basics.pptxComputer and programing basics.pptx
Computer and programing basics.pptx
 
Program logic and design
Program logic and designProgram logic and design
Program logic and design
 
Savitch ch 01
Savitch ch 01Savitch ch 01
Savitch ch 01
 
Savitch ch 01
Savitch ch 01Savitch ch 01
Savitch ch 01
 
CHAPTER 1
CHAPTER 1CHAPTER 1
CHAPTER 1
 
Fundamentals of programming with C++
Fundamentals of programming with C++Fundamentals of programming with C++
Fundamentals of programming with C++
 
Book ppt
Book pptBook ppt
Book ppt
 
C++ advanced PPT.pdf
C++ advanced PPT.pdfC++ advanced PPT.pdf
C++ advanced PPT.pdf
 

More from Ans Ali

Project,ATM Project,Java Atm Project
Project,ATM Project,Java Atm ProjectProject,ATM Project,Java Atm Project
Project,ATM Project,Java Atm ProjectAns Ali
 
Sort techniques
Sort techniquesSort techniques
Sort techniquesAns Ali
 
Dbms quries
Dbms quriesDbms quries
Dbms quriesAns Ali
 
chap 2 Ex#1.1
chap 2 Ex#1.1chap 2 Ex#1.1
chap 2 Ex#1.1Ans Ali
 
Intro to computing
Intro to computingIntro to computing
Intro to computingAns Ali
 
File handling
File handlingFile handling
File handlingAns Ali
 
MS-Commands
 MS-Commands MS-Commands
MS-CommandsAns Ali
 
Types of Arrays
Types of ArraysTypes of Arrays
Types of ArraysAns Ali
 

More from Ans Ali (8)

Project,ATM Project,Java Atm Project
Project,ATM Project,Java Atm ProjectProject,ATM Project,Java Atm Project
Project,ATM Project,Java Atm Project
 
Sort techniques
Sort techniquesSort techniques
Sort techniques
 
Dbms quries
Dbms quriesDbms quries
Dbms quries
 
chap 2 Ex#1.1
chap 2 Ex#1.1chap 2 Ex#1.1
chap 2 Ex#1.1
 
Intro to computing
Intro to computingIntro to computing
Intro to computing
 
File handling
File handlingFile handling
File handling
 
MS-Commands
 MS-Commands MS-Commands
MS-Commands
 
Types of Arrays
Types of ArraysTypes of Arrays
Types of Arrays
 

Recently uploaded

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 

Recently uploaded (20)

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 

Into to programming fundamentals

  • 2.
  • 4. Why are you taking cs?
  • 5. Are these your motivation?  Because many people take it  Just a random choice, no particular reasons  A required course  I would like to just get a better grade  I would like to get programming skills and then grades  More …
  • 6. I believe your REAL motivation is ... I take it because I am interested
  • 7. See course outline for : Course Objectives, Outcomes, Weekly Lecture Plan, Assessment, Grading Scheme, Textbooks etc.
  • 8. Five Tips to Success
  • 9. 9 Try more exercises and more practice
  • 11. 11 Do the labs and assignments by yourself
  • 12. 12 Be patient with the machine
  • 13. 13 If you really need that, do it quietly ...
  • 14. 3/3/2018Programming Fundamental-I 14 Please don’t go to home with a bundle of questions in your mind!
  • 15. Learning Philosophy  · Lectures provide the first pass at course materials. They provide preliminary understanding and knowledge.  · Labs provide a more interactive environment in which help is available to clarify further understanding of the course materials. This activity also provides first hand implementation of problems using C.  · Assignments provide more complicated exercises to understand the concepts of the course. Implementation of a problem re-inforces the concepts of writing a program in C.  · Quiz and Examinations test your knowledge of the course materials covered.
  • 16.  This course is for you!  This course will build your strong foundation for upcoming courses of the degree  Without the students the university wouldn’t exist  If you have questions, or any suggestions, please let me know  You can also always ask me questions via e-ma At: MadihaTariq777@gmail.com
  • 19. 3/3/2018Programming Fundamentals 19  Five main components  Input devices  Allows the user to input data for processing  Output devices  To display the output to the monitor or getting printed copy  Processor CPU CU ALU AU LU  Main memory  Memory locations containing the running program  Secondary memory  Permanent record of data often on a disk Background Computer Systems
  • 20. 3/3/2018Programming Fundamentals 20  Processor Typically called the CPU  Central Processing Unit  Follows program instructions  Typical capabilities of CPU include: add subtract multiply divide move data from location to location Background Computer Systems
  • 21. 3/3/2018Programming Fundamentals 21  Data:  Raw facts and figures provided as input to computer  Information:  Data After Processing by computer is called information Computer Data Information Background Data & Information
  • 22. 3/3/2018Programming Fundamentals 22  A computer program is…  A set of instructions written in a sequence to solve a particular task.  Computer software is …  The collection of programs used by a computer  Includes: • Editors • Translators • System Managers • Operating Systems • Games etc Background Computer Program
  • 23. 3/3/2018Programming Fundamentals 23  Computer understands Machine Language  ‘A’ may look like 01000001  65 may look like 01000001  An instruction may look like 01000001  Programming Languages  Types  High Level Languages (C, C++, Java, Pascal, Visual Basic, FORTRAN, COBOL, Lisp, Scheme, Ada)  Low Level Languages (Assembly Language) Background Programming Languages
  • 24. 3/3/2018Programming Fundamentals 24  High – Level languages  Resemble human languages  Are designed to be easy to read and write  Must be translated to zeros and ones for the CPU to execute a program Background Programming Languages
  • 25. 3/3/2018Programming Fundamentals 25  Low – Level Languages  An assembly language command such as ADD X Y Z might mean add the values found at x and y in memory, and store the result in location z.  Assembly language must be translated to machine language (zeros and ones) 0110 1001 1010 1011  The CPU can follow machine language Background Programming Languages
  • 26. 3/3/2018Programming Fundamentals 26  Translate Programming language to machine language Code in Programming Language Language Translator Code in Machine Language Assembler (Translates low level or assembly language program into machine code and also check errors) Compiler (Translates High level language program into machine code and also check errors) Translator Types Background Language Translators
  • 27. 3/3/2018Programming Fundamentals 27  Translate high-level language to machine language  Source code  the original program in a high level language  Object code  the translated version in machine language Source Code (Code in High Level Language) Language Translator Object Code (Code in Machine Language) Background Source Code and Object Code
  • 28. 3/3/2018Programming Fundamentals 28 #include<stdio.h> Int main() { Printf(“Hello”); Return 0; } C Compile r 1011110100101 0101010101010 1111000011100 1010101010101 0101010101011 1100110011000 Background Language Translators
  • 29. 3/3/2018Programming Fundamental-I 29 Computer Input Data Output Solution Information Problem Algorithm Problem Solving Abstraction Process of extracting essential information about a problem is called abstraction. An Algorithm is a finite set of steps carried out to solve a problem. Or A sequence of precise instructions which leads to a solution. A set of instructions written in a sequence, acc. to algorithm, to solve a problem is called program.
  • 30. 3/3/2018Visual Programming 30  Problem: To develop a software that get two numbers, calculate sum and then displays the result on screen.  Abstraction  Algorithm  1. Start  2. Input A  3. Input B  4. Sum=A+B  5. Display Sum  6. En  Computer Program (Code)  #include<stdio.h>  int main()  {  int a, b, c;  printf("Enter two numbers to addn");  scanf("%d%d",&a,&b);  c = a + b;  printf("Sum of entered numbers = %dn",c);  return 0;  } For Example Compile and Run Output Sum=A+B
  • 31.
  • 32.
  • 33. What makes a bad program?  Writing Code without detailed analysis and design  Repeating trial and error without understanding the problem  Debugging the program line by line, statement by statement  Writing tricky and dirty programs
  • 34. PROGRAMMER'S DRINKING SONG!! 100 little bugs in the code, 100 bugs in the code, fix one bug, compile it again, 101 little bugs in the code. 101 little bugs in the code … Repeat until BUGS = 0 —The Internet Joke Book
  • 35. Group Discussions are mandatory for effective learning!