Creating Computer Programs lesson 27. This lesson includes the following sections: What is a Computer Program? How Programs Solve Problems Two Approaches:

Slides:



Advertisements
Similar presentations
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Advertisements

Computers Are Your Future
Software. What Is Software? software –Also called Computer programs –Are a list of instructions –Instructions are called code –CPU performs the instructions.
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
Chapter 1 Program Design
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
Chapter 8: Introduction to High-Level Language Programming Invitation to Computer Science, C++ Version, Fourth Edition.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Chapter 3 Planning Your Solution
CPU Processor-on-a-chip.
Intro to Programming CST JavaScript. Objectives Define software Identify the different types of software Differentiate the different types of programming.
CCSA 221 Programming in C CHAPTER 2 SOME FUNDAMENTALS 1 ALHANOUF ALAMR.
Simple Program Design Third Edition A Step-by-Step Approach
CSC141 Introduction to Computer Programming
Programming. What is a Program ? Sets of instructions that get the computer to do something Instructions are translated, eventually, to machine language.
UniMAP Sem1-08/09EKT120: Computer Programming1 Week 1 – Lecture 1.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
Lecture No 10 Extending the Processor’s Power to Other Devices Microcomputer Processors Creating Computer Programs.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
Chapter 12 Computer Programming. Chapter Contents Chapter 12: Computer Programming 2  Section A: Programming Basics  Section B: Procedural Programming.
The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the.
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Intro to Programming Web Design ½ Shade Adetoro. Programming Slangs IDE - Integrated Development Environment – the software in which you develop an application.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
Programming and Languages Dept. of Computer and Information Science IUPUI.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
UniMAP Sem2-10/11 DKT121: Fundamental of Computer Programming1 Introduction to C – Part 1.
Introduction to Computers Lesson 13A. home Computer Program A set of instructions or statements, also called code, to be carried out by the computer’s.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Introduction to Problem Solving Programming is a problem solving activity. When you write a program, you are actually writing an instruction for the computer.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Programming Languages
Computational Thinking, Problem-solving and Programming: General Principals IB Computer Science.
Key Ideas from day 1 slides
Topics Introduction to Repetition Structures
An Introduction to Visual Basic .NET and Program Design
Computer Programming.
ALGORITHMS AND FLOWCHARTS
Chapter 8: Introduction to High-Level Language Programming
Topics Introduction Hardware and Software How Computers Store Data
Global Challenge Night Sensor Lesson 2.
ALGORITHMS AND FLOWCHARTS
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
Global Challenge Night Sensor Lesson 2.
Chapter 1 Introduction(1.1)
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Topics Introduction to Value-returning Functions: Generating Random Numbers Writing Your Own Value-Returning Functions The math Module Storing Functions.
A programming language
Creating Computer Programs
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
ICT Gaming Lesson 2.
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Creating Computer Programs
Programming Logic and Design Eighth Edition
Presentation transcript:

Creating Computer Programs lesson 27

This lesson includes the following sections: What is a Computer Program? How Programs Solve Problems Two Approaches: Structured & Object-Oriented Programming

Files Hardware/Software Interaction What is a Computer Program?

What is a Computer Program? - Files Typically, a program is stored as a collection of files. Some common file types used in programs are: Executable (.EXE) files actually send commands to the processor. Dynamic Link Library (.DLL) files are partial.EXE files. Initialization (.INI) files contain configuration information for a program. Help (.HLP) files contain information for the user.

The program tells the CPU to process interrupts, or sets of steps the CPU must follow to perform a task. To control hardware, a program must be written in binary numbers (1s and 0s). This code is called machine code or machine language. Programmers use programming languages to write code in nearly human language. The resulting description is called source code. Compilers and interpreters translate a program into object code, the binary version of source code. What is a Computer Program? - Hardware/Software Interaction

Program Control Flow Algorithms Heuristics Common Flow Patterns Variables and Functions How Programs Solve Problems

The order in which program statements are executed is called program control flow. To determine program control flow, programmers may use a flowchart to map the program's sequence. Programmers may also create a simple text version of a program's code – called pseudocode – to determine how the program will flow. How Programs Solve Problems – Program Control Flow

This flowchart shows that the sequence can vary depending on conditions.

An algorithm is a set of steps that always lead to a solution. The steps are always the same, whether the problem is being solved manually or with a PC. A computer program may contain thousands of algorithms, each one devoted to a single task. An algorithm, for example, will find the highest point in a mountain range by comparing all the points until the highest one is found. How Programs Solve Problems - Algorithms

no

If a problem is too complex to be solved by an algorithm, a programmer may try to solve it by using heuristics. Heuristics are like algorithms, and will always find a solution to a problem. But unlike algorithms, heuristics are not guaranteed to find the best possible solution. A heuristic, for example, may find the highest point in a mountain range by comparing random points, but this process may never find the highest one. How Programs Solve Problems - Heuristics

To determine when and where to pass program control, a developer may use conditional statements or loops. A conditional statement determines whether a condition is true. If so, control flows to the next part of the program. A loop repeats again and again until a condition is met. Control then passes to another part of the program. How Programs Solve Problems - Common Flow Patterns

A variable is a named placeholder for data that is being processed. Programs contain variables to hold inputs from users, for example. A function is a set of steps that are followed to perform a specific task. By assembling a collection of functions together, a developer can build a complete program. How Programs Solve Problems - Variables and Functions

Structured programming Object-oriented programming Early programmers allowed control to pass from one part of a program to another by using goto statements. Control would "go to" a different part of the program when conditions allowed. Goto statements cause programs to become very complex. To eliminate their use, programmers developed two approaches to development: Two Approaches: Structured & Object-Oriented Programming

This type of programming has fallen into disfavor.

Sequence structure defines the default control flow. Selection structures are built around conditional statements. Repetition (looping) structures use loops, which execute according to the results of conditional statements. Structured programming uses three types of control structures to make program control flow more predictable: Two Approaches: Structured & Object-Oriented Programming - Structured Programming

In object-oriented programming (OOP), programs are built from blocks of code, called objects. Each object has functions and characteristics (attributes), and can contain (encapsulate) other objects. Objects that share common attributes can be grouped into classes. Classes can be divided into subclasses. In OOP, objects communicate with one another by exchanging messages. Two Approaches: Structured & Object-Oriented Programming - Object-Oriented Programming

Define the term computer program. Describe the use of flowcharts and pseudocode in programming. Identify two ways in which a program can work toward a solution. Differentiate the two main approaches to computer programming. List and describe three elements of object-oriented programming. lesson 27 Review