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)

PPTX
Introduction.pptx
ssusera8c91a
 
PPTX
Lecture 1.pptx
MAHAMASADIK
 
PPTX
Lesson 1 - Introduction to Computer Programming.pptx
Neil Mutia
 
PPT
Computer Programming Computer Programming
arifhasan88
 
DOCX
PROBLEM SOLVING
shahzadebaujiti
 
DOC
Stnotes doc 5
Alok Jain
 
DOCX
Chapter 2(1)
TejaswiB4
 
PPTX
Power Point Introduction To Programming 1
FabianDaffa3
 
DOCX
Introduction to Programming.docx
JohnBrianCatedrilla1
 
PPT
Program logic and design
Chaffey College
 
PPT
Chapter 1- C++ programming languages +.ppt
anawaarabdujabbaar
 
PDF
6272 cnote
P Kiran Sree
 
PDF
C progrmming
Shivam Singhal
 
PPTX
Programming Lecture 01 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
ZainabNoor83
 
PPT
01CHAP_1.PPT
ManoRanjani30
 
PDF
Python_Module_1.pdf
R.K.College of engg & Tech
 
DOCX
Contents Pre-requisites Approximate .docx
ShiraPrater50
 
Introduction.pptx
ssusera8c91a
 
Lecture 1.pptx
MAHAMASADIK
 
Lesson 1 - Introduction to Computer Programming.pptx
Neil Mutia
 
Computer Programming Computer Programming
arifhasan88
 
PROBLEM SOLVING
shahzadebaujiti
 
Stnotes doc 5
Alok Jain
 
Chapter 2(1)
TejaswiB4
 
Power Point Introduction To Programming 1
FabianDaffa3
 
Introduction to Programming.docx
JohnBrianCatedrilla1
 
Program logic and design
Chaffey College
 
Chapter 1- C++ programming languages +.ppt
anawaarabdujabbaar
 
6272 cnote
P Kiran Sree
 
C progrmming
Shivam Singhal
 
Programming Lecture 01 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
ZainabNoor83
 
01CHAP_1.PPT
ManoRanjani30
 
Python_Module_1.pdf
R.K.College of engg & Tech
 
Contents Pre-requisites Approximate .docx
ShiraPrater50
 
Ad

Recently uploaded (20)

PPTX
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
PDF
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
PDF
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
PDF
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
PDF
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
WSO2
 
PPTX
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
PDF
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
PDF
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
WSO2
 
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
Why aren't you using FME Flow's CPU Time?
Safe Software
 
Kubernetes - Architecture & Components.pdf
geethak285
 
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
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. )