How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.

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

Chapter 3: Modularization
Chapter 2: Modularization
Computers Are Your Future
Programming Logic and Design Fourth Edition, Introductory
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 2 - Problem Solving
زبانهای برنامه سازی برنامه سازی پیشرفته ارائه دهنده دکتر سيد امين حسيني E.mail: Home page:
Chapter 2- Visual Basic Schneider
McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 14 Programming and Languages.
Program Flow Charting How to tackle the beginning stage a program design.
Program Flow Charting How to tackle the beginning stage a program design.
Chapter 2: Input, Processing, and Output
Chapter 2: Developing a Program Extended and Concise Prelude to Programming Concepts and Design Copyright © 2003 Scott/Jones, Inc.. All rights reserved.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
COBOL for the 21 st Century Stern, Stern, Ley Chapter 1 INTRODUCTION TO STRUCTURED PROGRAM DESIGN IN COBOL.
Chapter 1 Program Design
Programming and Languages Chapter Competencies (Page 1 of 2) Describe the six steps of programming Discuss design tools including top-down design,
McGraw-Hill Technology Education © 2006 by the McGraw-Hill Companies, Inc. All rights reserved CHAPTER PROGRAMMING AND LANGUAGES.
1414 CHAPTER PROGRAMMING AND LANGUAGES. © 2005 The McGraw-Hill Companies, Inc. All Rights Reserved Competencies Describe the six steps of programming.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 3 Planning Your Solution
BPC.1 Basic Programming Concepts
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Chapter 2: Developing a Program Prelude to Programming Concepts and Design Copyright © 2001 Scott/Jones, Inc.. All rights reserved. 1 Chapter 2 Developing.
Programming Languages CPS120: Introduction to Computer Science Lecture 5.
Structured COBOL Programming, Stern & Stern, 9th edition
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Developing a Program.
Simple Program Design Third Edition A Step-by-Step Approach
CIS Computer Programming Logic
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
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.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
Programming Lifecycle
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
Designing and Debugging Batch and Interactive COBOL Programs Chapter 5.
The Software Development Life Cycle. Software Development SDLC The Software Development Life-Cycle Sometimes called the program development lifecycle.
Programming Concepts Chapter 3.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
Computing Essentials 2014 Programming and Languages © 2014 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
CPS120 Introduction to Computer Programming The Programming Process.
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
Programming at a high level. Developing a Computer Program Programmer  Writes program in source code (VB or other language) Compiler  Converts source.
1 Programming with MATLAB ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
The basics of the programming process The development of programming languages to improve software development Programming languages that the average user.
Programming and Languages
1 Program Planning and Design Important stages before actual program is written.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Structured Programming (4 Credits)
How to Program? -- Part 1 Part 1: Problem Solving –Analyze a problem –Decide what steps need to be taken to solve it. –Take into consideration any special.
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
Problem-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
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.
How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
ICS 3UI - Introduction to Computer Science
Programming Languages
Chapter 2- Visual Basic Schneider
Lecture 2 Introduction to Programming
Chapter 2- Visual Basic Schneider
Programming Logic and Design Eighth Edition
Presentation transcript:

How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5

Problem Solving Is an art, not a science It must be experienced, it can't be taught –Guidelines can be provided Based on experience Sound like platitudes Are internalized as we learn to solve problems It requires patience

Problem Solving Tasks Establish the context of the problem –Understand the problem –Determine the primary goals of the solution –Create a solution

Problem Solving Guidelines One big problem is unsolvable –Many small problems can be managed Understand the problem: What is needed? –Write on paper what results are expected –What functions (procedures) will be required to generate these results –What information will need to be given to these functions –Describe what the functions do before you write a single line of code

Programs A program is a set of step-by-step instructions that directs the computer to do the tasks you want it to do and produce the results you want.

The Program Development Cycle

Understand the problem Become familiar with what the program is trying to accomplish –Read the specifications –Ask questions –Understand the specifications Eliminate extraneous information

Analyze Determine inputs –·Variable NAMES –·Variable TYPES –·Ranges of VALUES Names and types of OBJECTS in appropriate. Determine outputs –·Output Values –·Indicate VARIABLE NAMES to store output values –·Determine VARIABLE TYPE of output variables

Plan the Program’s Logic Decide how to best meet the program’s specifications Often uses a flowchart or pseudocode Divide the program into subroutines, functions or modules –Subroutines cost less and take less time to maintain –Can be used in other programs –Several programmers can work on the same project

Develop a Solution Create a FLOW CHART based on mapping Test flow chart for RELIABILITY - all inputs produce proper output Write PSEUDO CODE based on flow chart –Test flow chart for reliability.

Code the Program Put the solution, generally documented with pseudocode or a flowchart into a programming language CODE the solution –Select an appropriate language (C++) –Code the pseudo code –Create a user interface if required

Machine-Readable Form Key the program into a computer

Translate the program Translated into machine language using an assembler, a compiler or an interpreter Includes the elimination of syntax errors Generate executable file

Test the Program Logic errors are not listed during the translation projects Only way to find logic errors is to do program testing –Involves using sample data as input –Executing the program –Checking the results manually Know as debugging

Planning Your Tests Create an input file that tests all input ranges –If there are independent input values, test all values –If there are ranges of input values, test the middle of each range, and the upper and lower bounds on each range break –For example, of the range is integers from 1 to 10, check:

Document the Program Internal Documentation –Comments External Documentation –Program specification –Layout chart –Hierarchy chart –Program flowchart –Pseudo-code –Data Dictionary Input, Output, Work Area Name, description, type, initial value, calculation –Source listing –Test Plan

Programming Languages A programming language is a set of rules that provides a way of telling a computer what operations to perform.

Levels of Programming Languages Machine language Assembly Language High Level Languages Fourth Generation Languages (4GL)

Fundamental Programming Concepts Assignment of values to a variable Iteration (Looping) –Over a set of set of statements –With respect to a logical expressions (conditions) Delegation of sub-tasks to functions / procedures