SlideShare a Scribd company logo
Overview of Object-Oriented Programming Learning to program a computer… is a matter of training yourself to solve problems is a detailed and organized manner is solving problems intuitively Is the skill of writing a problem solution in terms of objects and actions
What is Programming? Compared to human…since infancy, we  have been learning how to act, how to do things we learned to expect certain behaviours from everything we encounter what we do every day we do automatically.
Programming -  Developing instructions for carrying out a task involving a set of objects Computer -  A programmable device that can store, retrieve, and process data Data -  Information in a form that a computer can use Information -  Any knowledge that can be communicated Object -  A collection of data values and associated operations Computer programming -  The process of specifying objects and the ways in which those objects interact to solve a problem Computer program -  Instructions defining a set of objects and orchestrating their interactions to solve a problem
Programming Process
Problem-Solving Phase 1.  Analysis and specification . Understand (define) the problem and identify what the solution must do. 2.  General solution (algorithm) . Specify the objects and their interactions that solve the problem. 3.  Verify . Follow the steps exactly to see if the solution really does solve the problem. Implementation Phase 1.  Concrete solution (program) . Translate the object specifications and algorithms (the general solution) into a programming language. 2.  Test . Have the computer carry out the program and then check the results. If you find errors, analyze the program and the general solution to determine the source of the errors, and then make corrections. Once a program has been written, it enters a third phase:  maintenance . Maintenance Phase 1.  Use . Use the program. 2.  Maintain . Modify the program to meet changing requirements or to correct any errors that show up in using it.
Class -  A description of the representation of a specific kind of object, in terms of data and operational behaviours. Algorithm -  Instructions for solving a problem in a finite amount of time using a finite amount of data. Flowcharts –  are often used to graphically represent algorithms. Constructing an Algorithm Example : Objects: Employee Record, Personnel Database, Employee ID, Time Card, Pay Rate, Hours Worked, Regular Wages, Overtime Wages, Total Wages 1.  Get the Employee Record from the Personnel Database, using the Employee ID from the Time Card. 2.  Get the Pay Rate from the Employee Record. 3.  Get the Hours Worked during the week from the Time Card. 4.  If the number of Hours Worked is less than or equal to 40,multiply by the Pay Rate to calculate the Regular Wages. 5.  If the number of Hours Worked is greater than 40,multiply 40 by the Pay Rate to calculate the Regular Wages, and then multiply the Hours Worked minus 40 by 11⁄2 times the Pay Rate to calculate the Overtime Wages. 6.  Add the Regular Wages to the Overtime Wages (if any) to determine the Total Wages for the week.
Programming language –  A set of rules, symbols, and special words used to construct a computer program Code -  Instructions for a computer that are written in a programming language Note: An algorithm can be translated into more than one programming language. Each translation produces a different implementation (fig. a) Even when two people translate an algorithm into the same programming language, they often come up with different implementations (fig. b) Every programming language allows the programmer some flexibility in terms of how an algorithm is translated. Given this flexibility, people adopt their own  styles  in writing programs, just as they do in writing short stories or essays Some people try to speed up the programming process by going directly from the problem definition to coding (fig. c). Taking such a shortcut is very tempting and, at first glance, seems to save a lot of time. This kind of shortcut actually consumes  more  time and requires more effort.  Developing a general solution before you write Java code will help you manage the problem, keep your thoughts straight, and avoid mistakes. If you don’t take the time at the beginning to think out and polish your algorithm, you’ll spend a lot of extra time debugging and revising your code. So think first and code later! The sooner you start coding, the longer it takes to write an application that works. (fig. c)
 
How Is Java Code Converted into a Form That a Computer Can Use?
 
 
 
Basic Control Structures of Programming Languages
 
Definitions Machine language -  The language, made up of binary coded instructions, that is used directly by the computer Assembly language -  A low level programming language in which a mnemonic represents each machine language instruction for a particular computer Assembler -  A program that translates an assembly language program into machine code Compiler -  A program that translates code written in a high-level language into machine code Source code -  Instructions written in a high-level programming language Object code -  A machine language version of a source code Bytecode -  A standard machine language into which Java source code is compiled Direct execution -  The process by which a computer performs the actions specified in a machine language program Interpretation -  The translation, while a program is running, of non machine language instructions (such as Bytecode) into executable operations Virtual machine -  A program that makes one computer act like another Data type -  The specification in a programming language of how information is represented in the computer as data and the set of operations that can be applied to it Instantiate -  To create an object based on the description supplied by a class. Package -  A collection of related classes
Memory unit -  Internal data storage in a computer Central processing unit (CPU)-  The part of the computer that executes the instructions (object code) stored in memory; made up of the arithmetic/logic unit and the control unit Arithmetic/logic unit (ALU)-  The component of the central processing unit that performs arithmetic and logical operations  Control unit  The component of the central processing unit that controls the actions of the other components so that instructions (the object code) execute in the correct sequence Input/output (I/O) devices -  The parts of the computer that accept data to be processed (input) and present the results of that processing (output) Peripheral device -  An input, output, or auxiliary storage device attached to a computer Auxiliary storage device –  A device that stores data in encoded form outside the computer’s main memory Hardware  The physical components of a computer Software  Computer programs; the set of all programs available on a computer Interface  A connecting link at a shared boundary that allows independent systems to meet and act on or communicate with each other Interactive system  A system that supports direct communication between the user and the computer Operating system  A set of programs that manages all of the computer’s resources Editor  An interactive program used to create and modify source programs or data
Problem-Solving Techniques Ask Questions Look for Things That Are Familiar Solve by Analogy Means-Ends Analysis Divide and Conquer The Building-Block Approach Merging Solutions Mental Blocks: The Fear of Starting Object-Oriented Problem Solving
Ask Questions Look for Things That Are Familiar
Solve by Analogy Means-Ends Analysis
The Building-Block Approach Divide and Conquer
Mental Blocks: The Fear of Starting Object-Oriented Problem Solving The initial step in solving many problems is to identify the obvious objects in the problem description. If you are given a recipe, for example, the first thing you do is to identify the ingredients. Some may already be in your cupboard or refrigerator. For others, you may have to go shopping. Object-oriented problem solving involves much the same process. You look at a problem statement and make a list of the objects in it. Some of those objects are already available in the Java library, just waiting to be used. Other objects you may have to write yourself. Remember that the computer can do only certain things. Your primary concern, then, is making the computer coordinate the actions of objects to produce the desired effects. If you keep in mind the objects, operations, and data types available in Java, you won’t design an algorithm that is difficult or impossible to code. ( PARTY PLANNING Problem:  You and some friends want to have a party on Saturday night, and you need to plan and prepare for it. )
QUESTIONS ???

More Related Content

Viewers also liked (19)

PPT
Cross-Lingual Web API Classification
mmaleshkova
 
PDF
CodeIgniterユーザガイドの翻訳に参加しよう!
kenjis
 
PPTX
2012 KM for Libraries webinar -Lapachet/Reynolds
Jaye Lapachet
 
PDF
達人出版会からPHPの本を出版しよう
kenjis
 
PDF
Linguagem sql
Tic Eslc
 
PDF
Linkedin presentation-red-1225231144081339-8
nizetanaiz
 
PPT
Lara Morgan - Its Up To You - Fresh Business Thinking LIVE at Cass Business S...
fbtslides
 
DOCX
Pedagogical analysis of laws of return
ruchiraasharma
 
PDF
บุหรี่
Jeenie Panmongkol
 
PPTX
EdComs Classroom Everywhere - Michaela Kirsop-Holdford
EdComs
 
PDF
de Flank & de Spits Haarlem
kcrabbendam
 
PDF
Fresh Business Thinking Social Media Event - Julie Hall
fbtslides
 
PPT
Spectrum deck v5.3
SLaM Iam
 
PPT
Automating the Use of Web APIs through Lightweight Semantics
mmaleshkova
 
PPT
ballorig
Roy Hermans
 
KEY
Understanding gc qconny2012
wgrahamt
 
PPTX
Youth nited for juan healthy nation
Bernard Cielo
 
PDF
Guide To Finance
Arvente Nicolita
 
PPS
Social Media Calendar 2011
Camelia Bulea
 
Cross-Lingual Web API Classification
mmaleshkova
 
CodeIgniterユーザガイドの翻訳に参加しよう!
kenjis
 
2012 KM for Libraries webinar -Lapachet/Reynolds
Jaye Lapachet
 
達人出版会からPHPの本を出版しよう
kenjis
 
Linguagem sql
Tic Eslc
 
Linkedin presentation-red-1225231144081339-8
nizetanaiz
 
Lara Morgan - Its Up To You - Fresh Business Thinking LIVE at Cass Business S...
fbtslides
 
Pedagogical analysis of laws of return
ruchiraasharma
 
บุหรี่
Jeenie Panmongkol
 
EdComs Classroom Everywhere - Michaela Kirsop-Holdford
EdComs
 
de Flank & de Spits Haarlem
kcrabbendam
 
Fresh Business Thinking Social Media Event - Julie Hall
fbtslides
 
Spectrum deck v5.3
SLaM Iam
 
Automating the Use of Web APIs through Lightweight Semantics
mmaleshkova
 
ballorig
Roy Hermans
 
Understanding gc qconny2012
wgrahamt
 
Youth nited for juan healthy nation
Bernard Cielo
 
Guide To Finance
Arvente Nicolita
 
Social Media Calendar 2011
Camelia Bulea
 

Similar to (Prog213) (introduction to programming)v1 (20)

PPT
computer programming introduction ppt.ppt
AlazarAlemayehu2
 
PPT
Program logic and design
Chaffey College
 
PPT
01CHAP_1.PPT
ManoRanjani30
 
PPT
Introduction to Programming
Chaffey College
 
PPTX
grade 10 2023.pptx
RaymartHerera
 
PPT
Problem Solving and Algorithm Design in Computer Science
RaviRaval36
 
PDF
Cois240 lesson01
Angel G Diaz
 
PPTX
Introduction to computer programming
Sangheethaa Sukumaran
 
PPT
C programming for Computing Techniques
Appili Vamsi Krishna
 
PPT
Chapter 1- C++ programming languages +.ppt
anawaarabdujabbaar
 
PPT
Computer Programming Computer Programming
arifhasan88
 
PPTX
a brief explanation on the topic of Imperative Programming Paradigm.pptx
sajit20
 
PPTX
C programming .pptx
SuhaibKhan62
 
PPTX
Unit no_1.pptx
Ganeshpatil499846
 
PDF
Introduction to computers
Learn By Watch
 
PPT
Problem Solving Techniques
Ashesh R
 
PDF
L1. Basic Programming Concepts.pdf
MMRF2
 
PDF
Problem Solving and Programming using C.pdf
PradeepT42
 
computer programming introduction ppt.ppt
AlazarAlemayehu2
 
Program logic and design
Chaffey College
 
01CHAP_1.PPT
ManoRanjani30
 
Introduction to Programming
Chaffey College
 
grade 10 2023.pptx
RaymartHerera
 
Problem Solving and Algorithm Design in Computer Science
RaviRaval36
 
Cois240 lesson01
Angel G Diaz
 
Introduction to computer programming
Sangheethaa Sukumaran
 
C programming for Computing Techniques
Appili Vamsi Krishna
 
Chapter 1- C++ programming languages +.ppt
anawaarabdujabbaar
 
Computer Programming Computer Programming
arifhasan88
 
a brief explanation on the topic of Imperative Programming Paradigm.pptx
sajit20
 
C programming .pptx
SuhaibKhan62
 
Unit no_1.pptx
Ganeshpatil499846
 
Introduction to computers
Learn By Watch
 
Problem Solving Techniques
Ashesh R
 
L1. Basic Programming Concepts.pdf
MMRF2
 
Problem Solving and Programming using C.pdf
PradeepT42
 
Ad

Recently uploaded (20)

PPTX
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
PDF
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
PPTX
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
PPTX
The birth and death of Stars - earth and life science
rizellemarieastrolo
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PDF
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PDF
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PDF
Next level data operations using Power Automate magic
Andries den Haan
 
PDF
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
The birth and death of Stars - earth and life science
rizellemarieastrolo
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
Kubernetes - Architecture & Components.pdf
geethak285
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
Why aren't you using FME Flow's CPU Time?
Safe Software
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
Next level data operations using Power Automate magic
Andries den Haan
 
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 
Ad

(Prog213) (introduction to programming)v1

  • 1. Overview of Object-Oriented Programming Learning to program a computer… is a matter of training yourself to solve problems is a detailed and organized manner is solving problems intuitively Is the skill of writing a problem solution in terms of objects and actions
  • 2. What is Programming? Compared to human…since infancy, we have been learning how to act, how to do things we learned to expect certain behaviours from everything we encounter what we do every day we do automatically.
  • 3. Programming - Developing instructions for carrying out a task involving a set of objects Computer - A programmable device that can store, retrieve, and process data Data - Information in a form that a computer can use Information - Any knowledge that can be communicated Object - A collection of data values and associated operations Computer programming - The process of specifying objects and the ways in which those objects interact to solve a problem Computer program - Instructions defining a set of objects and orchestrating their interactions to solve a problem
  • 5. Problem-Solving Phase 1. Analysis and specification . Understand (define) the problem and identify what the solution must do. 2. General solution (algorithm) . Specify the objects and their interactions that solve the problem. 3. Verify . Follow the steps exactly to see if the solution really does solve the problem. Implementation Phase 1. Concrete solution (program) . Translate the object specifications and algorithms (the general solution) into a programming language. 2. Test . Have the computer carry out the program and then check the results. If you find errors, analyze the program and the general solution to determine the source of the errors, and then make corrections. Once a program has been written, it enters a third phase: maintenance . Maintenance Phase 1. Use . Use the program. 2. Maintain . Modify the program to meet changing requirements or to correct any errors that show up in using it.
  • 6. Class - A description of the representation of a specific kind of object, in terms of data and operational behaviours. Algorithm - Instructions for solving a problem in a finite amount of time using a finite amount of data. Flowcharts – are often used to graphically represent algorithms. Constructing an Algorithm Example : Objects: Employee Record, Personnel Database, Employee ID, Time Card, Pay Rate, Hours Worked, Regular Wages, Overtime Wages, Total Wages 1. Get the Employee Record from the Personnel Database, using the Employee ID from the Time Card. 2. Get the Pay Rate from the Employee Record. 3. Get the Hours Worked during the week from the Time Card. 4. If the number of Hours Worked is less than or equal to 40,multiply by the Pay Rate to calculate the Regular Wages. 5. If the number of Hours Worked is greater than 40,multiply 40 by the Pay Rate to calculate the Regular Wages, and then multiply the Hours Worked minus 40 by 11⁄2 times the Pay Rate to calculate the Overtime Wages. 6. Add the Regular Wages to the Overtime Wages (if any) to determine the Total Wages for the week.
  • 7. Programming language – A set of rules, symbols, and special words used to construct a computer program Code - Instructions for a computer that are written in a programming language Note: An algorithm can be translated into more than one programming language. Each translation produces a different implementation (fig. a) Even when two people translate an algorithm into the same programming language, they often come up with different implementations (fig. b) Every programming language allows the programmer some flexibility in terms of how an algorithm is translated. Given this flexibility, people adopt their own styles in writing programs, just as they do in writing short stories or essays Some people try to speed up the programming process by going directly from the problem definition to coding (fig. c). Taking such a shortcut is very tempting and, at first glance, seems to save a lot of time. This kind of shortcut actually consumes more time and requires more effort. Developing a general solution before you write Java code will help you manage the problem, keep your thoughts straight, and avoid mistakes. If you don’t take the time at the beginning to think out and polish your algorithm, you’ll spend a lot of extra time debugging and revising your code. So think first and code later! The sooner you start coding, the longer it takes to write an application that works. (fig. c)
  • 8.  
  • 9. How Is Java Code Converted into a Form That a Computer Can Use?
  • 10.  
  • 11.  
  • 12.  
  • 13. Basic Control Structures of Programming Languages
  • 14.  
  • 15. Definitions Machine language - The language, made up of binary coded instructions, that is used directly by the computer Assembly language - A low level programming language in which a mnemonic represents each machine language instruction for a particular computer Assembler - A program that translates an assembly language program into machine code Compiler - A program that translates code written in a high-level language into machine code Source code - Instructions written in a high-level programming language Object code - A machine language version of a source code Bytecode - A standard machine language into which Java source code is compiled Direct execution - The process by which a computer performs the actions specified in a machine language program Interpretation - The translation, while a program is running, of non machine language instructions (such as Bytecode) into executable operations Virtual machine - A program that makes one computer act like another Data type - The specification in a programming language of how information is represented in the computer as data and the set of operations that can be applied to it Instantiate - To create an object based on the description supplied by a class. Package - A collection of related classes
  • 16. Memory unit - Internal data storage in a computer Central processing unit (CPU)- The part of the computer that executes the instructions (object code) stored in memory; made up of the arithmetic/logic unit and the control unit Arithmetic/logic unit (ALU)- The component of the central processing unit that performs arithmetic and logical operations Control unit The component of the central processing unit that controls the actions of the other components so that instructions (the object code) execute in the correct sequence Input/output (I/O) devices - The parts of the computer that accept data to be processed (input) and present the results of that processing (output) Peripheral device - An input, output, or auxiliary storage device attached to a computer Auxiliary storage device – A device that stores data in encoded form outside the computer’s main memory Hardware The physical components of a computer Software Computer programs; the set of all programs available on a computer Interface A connecting link at a shared boundary that allows independent systems to meet and act on or communicate with each other Interactive system A system that supports direct communication between the user and the computer Operating system A set of programs that manages all of the computer’s resources Editor An interactive program used to create and modify source programs or data
  • 17. Problem-Solving Techniques Ask Questions Look for Things That Are Familiar Solve by Analogy Means-Ends Analysis Divide and Conquer The Building-Block Approach Merging Solutions Mental Blocks: The Fear of Starting Object-Oriented Problem Solving
  • 18. Ask Questions Look for Things That Are Familiar
  • 19. Solve by Analogy Means-Ends Analysis
  • 20. The Building-Block Approach Divide and Conquer
  • 21. Mental Blocks: The Fear of Starting Object-Oriented Problem Solving The initial step in solving many problems is to identify the obvious objects in the problem description. If you are given a recipe, for example, the first thing you do is to identify the ingredients. Some may already be in your cupboard or refrigerator. For others, you may have to go shopping. Object-oriented problem solving involves much the same process. You look at a problem statement and make a list of the objects in it. Some of those objects are already available in the Java library, just waiting to be used. Other objects you may have to write yourself. Remember that the computer can do only certain things. Your primary concern, then, is making the computer coordinate the actions of objects to produce the desired effects. If you keep in mind the objects, operations, and data types available in Java, you won’t design an algorithm that is difficult or impossible to code. ( PARTY PLANNING Problem: You and some friends want to have a party on Saturday night, and you need to plan and prepare for it. )