SlideShare a Scribd company logo
1 of 23
CC-112
PROGRAMMING FUNDAMENTALS
Lecture No.1
Introduction To Problem Solving
Delivered By Aamir Shahzad
WHAT IS A PROGRAM ?
 A computer program is a set of computer instructions, which are
used for solving a problem. The program directs the computer to
perform the actions that are needed to arrive at a solution.
 The number of instructions required to solve a problem depends on
the complexity of the problem. These instructions may range from
a few to many hundreds or thousands.
 The computation might be something mathematical, such as
solving a system of equations or finding the roots of a polynomial.
 But it can also be a symbolic computation, such as searching and
replacing text in a document or (strangely enough) compiling a
program.
PROGRAMMING: A WAY OF THINKING
 Combines features from mathematics, engineering, and
natural science.
 Like mathematicians, computer scientists use formal
languages to denote ideas (specifically computations).
 Like engineers, they design things, assembling components
into systems and evaluating tradeoffs among alternatives.
 Like scientists, they observe the behavior of complex systems,
form hypotheses, and test predictions.
PROGRAMMING: A WAY OF THINKING
• The single most important skill for a computer scientist is
problem solving.
• Problem solving means:
• The ability to formulate problems, think creatively about solutions, and
express a solution clearly and accurately.
PROBLEMS? . . .
• The problem is not that there are problems. The problem is expecting
otherwise and thinking that having problems is a problem.“ Theodore Rubin
• The best way to escape from a problem is to solve it.--Brendan Francis
• Every problem contains within itself the seeds of its own solution.--Stanley
Arnold
• It isn't that they can't see the solution. It's that they can't see the problem.--
G. K. Chesterton
• Problems are to the mind what exercise is to the muscles, they toughen and
make strong. - Norman Vincent Peale
WHAT IS A PROBLEM (IN COMPUTING)
 A discrepancy between what is required and what exists.
 A computer program is meant to solve a problem.
 Think of a programming problem in the same light as you
would think of a mathematical problem. It's not something
bad(though some people may say otherwise).
 Rather, it is something that needs to be solved or a task that
needs to be accomplished.
WHAT IS PROBLEM SOLVING?
• Problem solving has long been recognized as one of the
hallmarks of mathematics.
• “Solving a problem means finding a way out of difficulty, a
way around an obstacle, attaining an aim which was not
immediately attainable.”
FOUR-STEP PROBLEM-SOLVING PROCESS
1. Understand the problem
2. Devise a plan
3. Carry out the plan
4. Look back
STEP-1: UNDERSTANDING THE PROBLEM
• Can you state the problem in your own words?
• What are you trying to find or do?
• What are the unknowns?
• What information do you obtain from the problem?
• What information, if any, is missing or not needed?
STEP-2: DEVISING A PLAN
(SOME STRATEGIES YOU MAY FIND USEFUL)
• Look for a pattern.
• Examine related problems and determine if the same technique can
be used.
• Examine a simpler problem to gain insight into the solution of the
original problem.
• Make a table or list.
• Make a diagram.
• Write an equation.
• Use guess and check.
• Work backward.
• Identify a subgoal.
• Use indirect reasoning.
• Use direct reasoning.
STEP-3: CARRYING OUT THE PLAN
• Implement the strategy or strategies.
• Check each step of the plan as you proceed.
• Keep an accurate record of your work.
• Implement the strategy of strategies in step 2 and perform
any necessary actions or computations.
• Check each step of the plan as you proceed. This may be
intuitive checking or a formal proof of each step.
• Keep an accurate record of your work. Label each step.
STEP-4: LOOKING BACK
CHECK THE RESULTS IN THE ORIGINAL PROBLEM
• Interpret the solution in terms of the original problem.
• Determine whether there is another method of finding the
solution.
• If possible, determine other related or more general problems
for which the techniques will work.
DEVELOPMENT OF COMPUTER SOLUTION
• Identify or Define the problem
• Analyze the problem in terms of inputs, outputs, formulas,
constants)
• Design the Solution
• Represent the most efficient solution in the form of an
algorithm.
• Implement (program coding)
• Evaluate
IDENTIFY OR DEFINE THE PROBLEM
 In order for you to come up with an algorithm to solve a
problem, you must first have a clear understanding of what
the problem is.
 The first thing you have to do is to obtain a problem
statement (a clear definition of the problem that needs to be
solved).
 At this level it will usually be provided for you, but in the real
world the programmer would have to work with his client to
come up with one.
 Here are some (very simple) examples of problem statements:
ANALYZE THE PROBLEM
 We need to read it till we understand every detail
 We need to dissect the problem into its component parts (e.g.
problems and sub-problems)
 We need to remove any ambiguity, extra information
 We need to determine our knowns and our unknowns
 We need to be aware of any assumptions we are making.
ANALYZE THE PROBLEM
The Program Must Read Two Numbers And Print The Total Of
The Two.
 Determining the input, output, processing and storage
 The next step in defining the problem is to break it down into
its main components:
1. Inputs - the data you are provided with or have to obtain from the
user. Some words that help you to identify the inputs are: read, input,
enter, given, accept
2. Outputs - the results that should be produced
3. Processing - the tasks that must be performed, i.e. what must be
done with the inputs to get the outputs
4. Storage - the data that must be stored
ANALYZE THE PROBLEM
The Program Must Read Two Numbers And Print The Total Of
The Two.
• Inputs - The word 'read' tells us that the inputs will be in the form of two
numbers. For reasons that will be explained later, it's helpful to give the
inputs names, so we'll call them numl and num2.
• Outputs - The desired result is the total, so we'll call the output 'total’.
• Processing - Reading the two numbers is processing and so is printing the
total. But is that everything? The total doesn't magically appear. You have
to do something to the inputs to obtain the total. So there is an in-
between step that is implied - calculating the total.
• Storage - the data that must be stored
ANALYZE THE PROBLEM
The Program Must Read Two Numbers And Print The Total Of
The Two.
• Defining diagrams
• One way of illustrating the main components of a problem is by using
a defining diagram.
• A defining diagram is a table with three columns: 'Input', 'Processing'
and 'Output'.
• Consider the following problem statement:
Write a program that reads two numbers and prints the total.
• Even this simple statement requires some detective work to figure out
the input, output and especially the processing.
• the defining diagram would look like this:
Input Processing Output
Two Numbers, i.e.
numl, num2
Read two numbers
Total
Calculate the total
Print the total
DESIGN THE SOLUTION
 Developing the algorithm that solves the
problem
 Identify alternative ways to solve the problem
 Select the best way to solve the problem from the list
of alternative solutions
 List instructions that enable you to solve the problem
using selected solution
 The algorithm is expressed a s flowchart or
pseudo-code
PAYROLL EXAMPLE - ANALYSIS
PAYROLL EXAMPLE - DESIGN
PROGRAM COMPONENTS
 A few basic instructions appear in every language:
 Input - Get data from the keyboard, a file, or some other device.
 Output - Display data on the screen or send data to a file or other
device.
 Math Perform basic mathematical operations like addition and
multiplication.
 Conditional execution - Check for certain conditions and execute
the appropriate sequence of statements.
 Repetition/Looping - Perform some action repeatedly, usually with
some variation.
WHAT IS DEBUGGING?
 Programming errors are called bugs and the process of tracking them down and
correcting them is called debugging.
 Three kinds of errors can occur in a program:
1. Syntax errors
 A program can only be executed if it is syntactically correct; otherwise, the process fails and returns an
error message.
 syntax refers to the structure of a program and the rules about that structure.
2. Runtime errors
 So called because the error does not appear until you run the program.
 These errors are also called exceptions because they usually indicate that something exceptional (and
bad) has happened.
3. Semantic errors
 If there is a semantic error in the program, it will run successfully, in the sense that the computer will
not generate any error messages, but it will not do the right thing. It will do something else.
Specifically, it will do what the programmer told it to do.
 But the written program does not solve the original problem. The meaning of the program (its
semantics) is wrong.

More Related Content

Similar to CC-112-Lec.1.ppsx

(Prog213) (introduction to programming)v1
(Prog213) (introduction to programming)v1(Prog213) (introduction to programming)v1
(Prog213) (introduction to programming)v1
Aaron Angeles
 
Algorithm for computational problematic sit
Algorithm for computational problematic sitAlgorithm for computational problematic sit
Algorithm for computational problematic sit
Saurabh846965
 
Lecture 7 program development issues (supplementary)
Lecture 7  program development issues (supplementary)Lecture 7  program development issues (supplementary)
Lecture 7 program development issues (supplementary)
alvin567
 
Algorithm types performance steps working
Algorithm types performance steps workingAlgorithm types performance steps working
Algorithm types performance steps working
Saurabh846965
 
Programming Fundamentals using C++
Programming Fundamentals using C++Programming Fundamentals using C++
Programming Fundamentals using C++
ALI RAZA
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
Prof. Erwin Globio
 

Similar to CC-112-Lec.1.ppsx (20)

Pj01 1-computer and programming fundamentals
Pj01 1-computer and programming fundamentalsPj01 1-computer and programming fundamentals
Pj01 1-computer and programming fundamentals
 
Data structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptData structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 ppt
 
(Prog213) (introduction to programming)v1
(Prog213) (introduction to programming)v1(Prog213) (introduction to programming)v1
(Prog213) (introduction to programming)v1
 
Algorithm.pdf
Algorithm.pdfAlgorithm.pdf
Algorithm.pdf
 
Algorithm for computational problematic sit
Algorithm for computational problematic sitAlgorithm for computational problematic sit
Algorithm for computational problematic sit
 
Chapter 2(1)
Chapter 2(1)Chapter 2(1)
Chapter 2(1)
 
Lecture 7 program development issues (supplementary)
Lecture 7  program development issues (supplementary)Lecture 7  program development issues (supplementary)
Lecture 7 program development issues (supplementary)
 
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHESC LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
 
Algorithm types performance steps working
Algorithm types performance steps workingAlgorithm types performance steps working
Algorithm types performance steps working
 
Csc 102 lecture note(introduction to problem solving)
Csc 102 lecture note(introduction to problem solving)Csc 102 lecture note(introduction to problem solving)
Csc 102 lecture note(introduction to problem solving)
 
Programming Fundamentals using C++
Programming Fundamentals using C++Programming Fundamentals using C++
Programming Fundamentals using C++
 
Programming_Lecture_1.pptx
Programming_Lecture_1.pptxProgramming_Lecture_1.pptx
Programming_Lecture_1.pptx
 
Problem solving
Problem solvingProblem solving
Problem solving
 
Concept of Algorithm.pptx
Concept of Algorithm.pptxConcept of Algorithm.pptx
Concept of Algorithm.pptx
 
Ch2.ppt
Ch2.pptCh2.ppt
Ch2.ppt
 
Unit 1 program development cycle
Unit 1 program development cycleUnit 1 program development cycle
Unit 1 program development cycle
 
C programming for Computing Techniques
C programming for Computing TechniquesC programming for Computing Techniques
C programming for Computing Techniques
 
CS8461 - Design and Analysis of Algorithms
CS8461 - Design and Analysis of AlgorithmsCS8461 - Design and Analysis of Algorithms
CS8461 - Design and Analysis of Algorithms
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
Software Design
Software DesignSoftware Design
Software Design
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

CC-112-Lec.1.ppsx

  • 1. CC-112 PROGRAMMING FUNDAMENTALS Lecture No.1 Introduction To Problem Solving Delivered By Aamir Shahzad
  • 2. WHAT IS A PROGRAM ?  A computer program is a set of computer instructions, which are used for solving a problem. The program directs the computer to perform the actions that are needed to arrive at a solution.  The number of instructions required to solve a problem depends on the complexity of the problem. These instructions may range from a few to many hundreds or thousands.  The computation might be something mathematical, such as solving a system of equations or finding the roots of a polynomial.  But it can also be a symbolic computation, such as searching and replacing text in a document or (strangely enough) compiling a program.
  • 3. PROGRAMMING: A WAY OF THINKING  Combines features from mathematics, engineering, and natural science.  Like mathematicians, computer scientists use formal languages to denote ideas (specifically computations).  Like engineers, they design things, assembling components into systems and evaluating tradeoffs among alternatives.  Like scientists, they observe the behavior of complex systems, form hypotheses, and test predictions.
  • 4. PROGRAMMING: A WAY OF THINKING • The single most important skill for a computer scientist is problem solving. • Problem solving means: • The ability to formulate problems, think creatively about solutions, and express a solution clearly and accurately.
  • 5. PROBLEMS? . . . • The problem is not that there are problems. The problem is expecting otherwise and thinking that having problems is a problem.“ Theodore Rubin • The best way to escape from a problem is to solve it.--Brendan Francis • Every problem contains within itself the seeds of its own solution.--Stanley Arnold • It isn't that they can't see the solution. It's that they can't see the problem.-- G. K. Chesterton • Problems are to the mind what exercise is to the muscles, they toughen and make strong. - Norman Vincent Peale
  • 6. WHAT IS A PROBLEM (IN COMPUTING)  A discrepancy between what is required and what exists.  A computer program is meant to solve a problem.  Think of a programming problem in the same light as you would think of a mathematical problem. It's not something bad(though some people may say otherwise).  Rather, it is something that needs to be solved or a task that needs to be accomplished.
  • 7. WHAT IS PROBLEM SOLVING? • Problem solving has long been recognized as one of the hallmarks of mathematics. • “Solving a problem means finding a way out of difficulty, a way around an obstacle, attaining an aim which was not immediately attainable.”
  • 8. FOUR-STEP PROBLEM-SOLVING PROCESS 1. Understand the problem 2. Devise a plan 3. Carry out the plan 4. Look back
  • 9. STEP-1: UNDERSTANDING THE PROBLEM • Can you state the problem in your own words? • What are you trying to find or do? • What are the unknowns? • What information do you obtain from the problem? • What information, if any, is missing or not needed?
  • 10. STEP-2: DEVISING A PLAN (SOME STRATEGIES YOU MAY FIND USEFUL) • Look for a pattern. • Examine related problems and determine if the same technique can be used. • Examine a simpler problem to gain insight into the solution of the original problem. • Make a table or list. • Make a diagram. • Write an equation. • Use guess and check. • Work backward. • Identify a subgoal. • Use indirect reasoning. • Use direct reasoning.
  • 11. STEP-3: CARRYING OUT THE PLAN • Implement the strategy or strategies. • Check each step of the plan as you proceed. • Keep an accurate record of your work. • Implement the strategy of strategies in step 2 and perform any necessary actions or computations. • Check each step of the plan as you proceed. This may be intuitive checking or a formal proof of each step. • Keep an accurate record of your work. Label each step.
  • 12. STEP-4: LOOKING BACK CHECK THE RESULTS IN THE ORIGINAL PROBLEM • Interpret the solution in terms of the original problem. • Determine whether there is another method of finding the solution. • If possible, determine other related or more general problems for which the techniques will work.
  • 13. DEVELOPMENT OF COMPUTER SOLUTION • Identify or Define the problem • Analyze the problem in terms of inputs, outputs, formulas, constants) • Design the Solution • Represent the most efficient solution in the form of an algorithm. • Implement (program coding) • Evaluate
  • 14. IDENTIFY OR DEFINE THE PROBLEM  In order for you to come up with an algorithm to solve a problem, you must first have a clear understanding of what the problem is.  The first thing you have to do is to obtain a problem statement (a clear definition of the problem that needs to be solved).  At this level it will usually be provided for you, but in the real world the programmer would have to work with his client to come up with one.  Here are some (very simple) examples of problem statements:
  • 15. ANALYZE THE PROBLEM  We need to read it till we understand every detail  We need to dissect the problem into its component parts (e.g. problems and sub-problems)  We need to remove any ambiguity, extra information  We need to determine our knowns and our unknowns  We need to be aware of any assumptions we are making.
  • 16. ANALYZE THE PROBLEM The Program Must Read Two Numbers And Print The Total Of The Two.  Determining the input, output, processing and storage  The next step in defining the problem is to break it down into its main components: 1. Inputs - the data you are provided with or have to obtain from the user. Some words that help you to identify the inputs are: read, input, enter, given, accept 2. Outputs - the results that should be produced 3. Processing - the tasks that must be performed, i.e. what must be done with the inputs to get the outputs 4. Storage - the data that must be stored
  • 17. ANALYZE THE PROBLEM The Program Must Read Two Numbers And Print The Total Of The Two. • Inputs - The word 'read' tells us that the inputs will be in the form of two numbers. For reasons that will be explained later, it's helpful to give the inputs names, so we'll call them numl and num2. • Outputs - The desired result is the total, so we'll call the output 'total’. • Processing - Reading the two numbers is processing and so is printing the total. But is that everything? The total doesn't magically appear. You have to do something to the inputs to obtain the total. So there is an in- between step that is implied - calculating the total. • Storage - the data that must be stored
  • 18. ANALYZE THE PROBLEM The Program Must Read Two Numbers And Print The Total Of The Two. • Defining diagrams • One way of illustrating the main components of a problem is by using a defining diagram. • A defining diagram is a table with three columns: 'Input', 'Processing' and 'Output'. • Consider the following problem statement: Write a program that reads two numbers and prints the total. • Even this simple statement requires some detective work to figure out the input, output and especially the processing. • the defining diagram would look like this: Input Processing Output Two Numbers, i.e. numl, num2 Read two numbers Total Calculate the total Print the total
  • 19. DESIGN THE SOLUTION  Developing the algorithm that solves the problem  Identify alternative ways to solve the problem  Select the best way to solve the problem from the list of alternative solutions  List instructions that enable you to solve the problem using selected solution  The algorithm is expressed a s flowchart or pseudo-code
  • 20. PAYROLL EXAMPLE - ANALYSIS
  • 22. PROGRAM COMPONENTS  A few basic instructions appear in every language:  Input - Get data from the keyboard, a file, or some other device.  Output - Display data on the screen or send data to a file or other device.  Math Perform basic mathematical operations like addition and multiplication.  Conditional execution - Check for certain conditions and execute the appropriate sequence of statements.  Repetition/Looping - Perform some action repeatedly, usually with some variation.
  • 23. WHAT IS DEBUGGING?  Programming errors are called bugs and the process of tracking them down and correcting them is called debugging.  Three kinds of errors can occur in a program: 1. Syntax errors  A program can only be executed if it is syntactically correct; otherwise, the process fails and returns an error message.  syntax refers to the structure of a program and the rules about that structure. 2. Runtime errors  So called because the error does not appear until you run the program.  These errors are also called exceptions because they usually indicate that something exceptional (and bad) has happened. 3. Semantic errors  If there is a semantic error in the program, it will run successfully, in the sense that the computer will not generate any error messages, but it will not do the right thing. It will do something else. Specifically, it will do what the programmer told it to do.  But the written program does not solve the original problem. The meaning of the program (its semantics) is wrong.