Overview of Programming and Problem Solving ROBERT REAVES.

Slides:



Advertisements
Similar presentations
Senem Kumova Metin Introduction to Programming CS 115 Introduction to Computing PART I : Computer Basics PART II: Introduction to Computing/Programming.
Advertisements

ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
Overview. What is Computer Programming? It is the process of planning a sequence of steps (called instructions) for a computer to follow. 2 STEP 1 STEP.
Computer Science-I (CSIT121) Dr. Junaid Ahmed Zubairi SUNY at Fredonia Room 210, Fenton ,
This set of slides is provided by the author of the textbook1 Introductory Topics (Continued) l Computer Components l Basic Control Structures l Problem.
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
1 Chapter 1 Introduction to Object-Oriented Programming.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex.
This set of slides is provided by the author of the textbook1 Introductory Topics l Computer Programming l Programming Life-Cycle Phases l Creating an.
Chapter 1 Introduction to Object- Oriented Programming and Problem Solving.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems/Headington Slides by Sylvia Sorkin, Community College of Baltimore County - Essex Campus.
CIS 260 Computer Programming I in C Prof. Timothy Arndt.
Computer Science I CS rmaclin
CS 115 Chapter 1 Overview of Programming and Problem Solving.
CS102 Introduction to Computer Programming
1 Chapter 1 Overview of Programming and Problem Solving Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex Campus.
1 Author: Nell Dale Chip Weems Mark Headington Published By Higher Education Press Jones and Bartlett Publishers.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Chapter Introduction to Computers and Programming 1.
Introduction to Programming Dr Masitah Ghazali Programming Techniques I SCJ1013.
CSE 1340 Introduction to Computing Concepts Class 2.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex.
What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
CHAPTER 1 Overview of Programming and Problem Solving.
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
1 Overview of Programming and Problem Solving Chapter 1.
Overview of Programming and Problem Solving. Objectives In this chapter you will: Learn about different types of computers Explore the hardware and software.
Introduction to C++ Programming Language
Chapter 1: An Overview of Computers and Programming Languages
What is programming? Steps to solve a problem. Repeatable by executing or “doing” the steps again. UWP - Landgraf Some slides are from Dr. Qi Yang's notes.
Overview of Programming and Problem Solving Textbook Chapter 1 1.
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems/Headington.
Chapter 1 Overview of Programming and Problem Solving Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex Campus.
Chapter 1 Overview of Programming and Problem Solving 1.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex.
1 Chapter 1 Overview of Programming and Problem Solving Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex Campus.
Programming in C++ Dale/Weems/Headington Chapter 1 Overview of Programming and Problem Solving.
Chapter 1 Overview of Programming and Problem Solving CS185/09 - Introduction to Programming Caldwell College.
Chapter 1 : Overview of Computer and Programming By Suraya Alias
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
1 Overview of Programming Principles of Computers.
Chapter 1 An Overview of Computers and Programming Languages.
Introduction to Computer Programming using Fortran 77.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course.
Introduction to Programming By: Prof. Muhammad Abu Baker Siddique 2 nd Lecture 1.
1 Chapter 1 Overview of Programming and Problem Solving Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex Campus.
Cosc175 - lec11 Overview History Hardware Software Software Development Life Cycle Programming Languages Structured Programming Defining the Problem.
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1 Overview of Programming and Problem Solving
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Computer Science I CSC 135.
Chapter 1 Overview of Programming and Problem Solving
What is Computer Programming?
Overview History Hardware Software Software Development Life Cycle
Presentation transcript:

Overview of Programming and Problem Solving ROBERT REAVES

Outline  Overview of Programming  How Does a Computer Run a Program?  What’s Inside the Computer?  Ethics and Responsibilities in the Computer Profession  Problem-Solving Techniques

What is Programming?  It is the process of planning a sequence of steps (called instructions) for a computer to follow. STEP 1 STEP 2 STEP 3...

Overview of Programming  How Do We Write a Program?  A computer is not intelligent.  A computer frees people from repetitive and boring tasks.  Life Cycle Phases  Problem-Solving Phase  Implementation Phase  Maintenance Phase  This series of stages is known as the “waterfall model” of software development.

Problem-Solving Phase  ANALYZE the problem and SPECIFY what the solution must do.  Develop a GERNAL SOLUTION (Algorithm) to solve the problem.  VERIFY that your solution really solves the problem.

Algorithm  What Is an Algorithm?  A step by step procedure for solving a problem in a finite amount of time.  The heart of the programming process.  How do you start your car?  After being satisfied with the algorithm, we translate it into a programming language.

What is a Programming Language?  A set of rules, symbols, and special words used to construct a computer program.

Implementation Phase: Program  Translating your algorithm into a programming language is called coding.  No single way to implement an algorithm.  With C++, we use:  Documentation – your written comments  Compiler – translates your program into machine language  Main Program – may call sub-algorithms

Implementation Phase: Test  TESTING your program means running (executing) your program on the computer, to see if it produces correct results.  If it does not, then you must find out what is wrong with your program or algorithm and fix it—this is called debugging

Maintenance Phase  USE and MODIFY the program to meet changing requirements or correct errors that show up in using it.  Maintenance begins when your program is put into use and accounts for the majority of effort on most programs.

Programming Life Cycle  Problem-Solving Phase  Analysis and Specification  General Solution (Algorithm)  Verify  Implementation Phase  Concrete Solution (Program)  Test  Maintenance Phase  Use  Maintain

Shortcut? GOAL THINKING CODE REVISE DEBUG TEST CODE Shortcut?

Memory Organization  Two circuit states correspond to 0 and 1  Bit (short for binary digit) refers to a single 0 or 1. Bit patterns represent both the computer instructions and computer data.  1 byte = 8 bits  1 KB = 1024 bytes  1 MB = 1024 x 1024 = 1,048,576 bytes

How Many Possible Digits?  Binary (base 2) numbers use 2 digits: 0 & 1  Decimal (base 10) numbers use 10 digits: 0 - 9

Machine Language  Is NOT portable  Runs only on a specific type of computer  Is made up of binary-coded instructions (strings of 0s and 1s)  Is the language that can be directly used by the computer

High Level Language  ARE portable  User writes a program in a language similar to natural language  Examples:  FORTRAN  JAVA  C++  Most are standardized by ISO/ANSI to provide an official description of the language

Three C++ Program Stages other code from libraries, etc. other code from libraries, etc. written in machine language written in machine language written in machine language written in machine language written in C++ written in C++ via compilervia linker SOURCEOBJECT EXECUTABLE myprog.cppmyprog.objmyprog.exe

Basic Control Structures  A sequence is a series of statements that execute one after the other  Selection (branch) is used to execute different statements depending on certain conditions.  Looping (repetition) is used to repeat statements while certain conditions are met.  A subprogram is used to break the program into smaller units.

Sequence Statement...

Selection (branch)  IF Condition THEN Statement1 ELSE Statement2 Statement1 Statement Statement2 Condition... True False

Loop (repetition)  WHILE Condition DO statement1 Statement Condition... False True

Subprogram (function) SUBPROGRAM1... SUBPROGRAM1 a meaningful collection of SEQUENCE, SELECTION, LOOP, SUBPROGRAM

Computer Components Arithmetic Logic Unit Control Unit Auxiliary Storage Device Memory Unit ( RAM & Registers ) Central Processing Unit ( CPU ) Input Device Output Device Peripherals

Memory Unit  An ordered sequence of storage cells, each capable of holding a piece of information.  Each cell has it’s own unique address, used to store data into it or retrieve data from it. (memory locations)  The information held can be input data, computed values, or your program instructions.

Central Processing Unit  Has 2 components to execute program instructions  Arithmetic/Logic Unit performs arithmetic operations, and makes logical comparisons  Control Unit controls the order in which your program instructions are executed.

Peripherals  Are input, output, or auxiliary storage devices attached to a computer  Input Devices include keyboard and mouse.  Output Devices include printers, video display, LCD screens.  Auxiliary Devices include disk drives, scanners, CD-ROM and DVD-ROM drives, modems, sound cards, speakers, and digital cameras.

Computing Profession Ethics  Copy software only with permission from the copyright holder  Give credit to another programmer by name whenever using his/her code  Use computer resources only with permission  Guard the privacy of confidential data  Use software engineering principles to develop software free from errors

Problem Solving Techniques  Ask Questions – about the data, the process, the output, error conditions.  Look for familiar things – certain situations arise again and again.  Solve by Analogy – it may give you a place to start.  Use Means-Ends Analysis – Determine the I/O and then work out the details.

Problem Solving Techniques  Divide and Conquer – break up large problems into manageable units  Building Block approach – solve small pieces of the problem  Merge Solutions – instead of joining them end to end to avoid duplicate steps.  Overcome mental block – by rewriting the problem in your own words.

Some C++ History  1972: Dennis Ritchie at Bell Labs designs C and 90% of UNIX is then written in C  Late 70’s: OOP becomes popular  Bjarne Stroustrup at Bell Labs adds features to C to form “C with Classes”  1983: Name C++ first used  1998: ISO/ANSI standardization of C++