Cosc175 - lec11 Overview History Hardware Software Software Development Life Cycle Programming Languages Structured Programming Defining the Problem.

Slides:



Advertisements
Similar presentations
Overview of Programming and Problem Solving ROBERT REAVES.
Advertisements

Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
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.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Chapter 16 Programming and Languages: Telling the Computer What to Do.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Lecture Notes 8/30/05 Program Design & Intro to Algorithms.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems/Headington Slides by Sylvia Sorkin, Community College of Baltimore County - Essex Campus.
PRE-PROGRAMMING PHASE
Chapter 1 Introduction to Programming. Computer Hardware CPU Memory –Main or primary –Secondary or auxiliary Input device(s) Output device(s)
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers.
Computer Science I CS rmaclin
CS 115 Chapter 1 Overview of Programming and Problem Solving.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Tools make jobs easier to do -A computer is a tool used by many professions A computer can do many different jobs because they are programmable - Machine.
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.
Sw development1 Software Development 1.Define the problem (Analysis) 2.Plan the solution 3.Code 4.Test and debug 5.Maintain and Document.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex.
CHAPTER 1 Overview of Programming and Problem Solving.
Computer system overview1 The Effects of Computers Pervasive in all professions How have computers affected my life? How have computers affected my life?
1 Overview of Programming and Problem Solving Chapter 1.
Overview of Programming and Problem Solving Textbook Chapter 1 1.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
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.
Cosc175 - Define Problem/Design Solution/Pseudocode/Trace 1 DEFINE THE PROBLEM.
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
Computer and Programming. Computer Basics: Outline Hardware and Memory Programs Programming Languages and Compilers.
1 Overview of Programming Principles of Computers.
CSCI 161 Lecture 3 Martin van Bommel. Operating System Program that acts as interface to other software and the underlying hardware Operating System Utilities.
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.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Software Engineering Algorithms, Compilers, & Lifecycle.
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.
1 Chapter 1 Overview of Programming and Problem Solving Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex Campus.
Chapter 1 Introduction 2nd Semester H
Introduction to Computers and C++ Programming
CSCI-235 Micro-Computer Applications
Computer Programming.
Key Ideas from day 1 slides
Chapter 1 Overview of Programming and Problem Solving
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Unit# 8: Introduction to Computer Programming
Problem Solving Techniques
Chapter 1 Overview of Programming and Problem Solving
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Chapter 1 Introduction(1.1)
What is Computer Programming?
Overview History Hardware Software Software Development Life Cycle
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Introduction to Computer Programming
Basic Concepts of Algorithm
Programming Logic and Design Eighth Edition
Presentation transcript:

cosc175 - lec11 Overview History Hardware Software Software Development Life Cycle Programming Languages Structured Programming Defining the Problem

cosc175 - lec12 History of computers First Generation computers ( ) –vacuum tubes –used large amounts of electricity, heat,large and expensive – ENIAC - computed trajectories for U.S. Army – UNIVAC - first commercially available computer, census Second Generation computers ( ) – transistors, less heat – more reliable, less expensive Third Generation computers ( ) – integrated circuits – less heat, higher speed

cosc175 - lec13 History of computers Fourth Generation computers (1971-present) – microprocessor => Personal Computer –Apple II (1977), IBM PC (1981) –ARPANET (1969) –WWW (1991) –Today - cheaper, smaller, better Fifth Generation computers (present and beyond) –Artificial Intelligence invented-the-computer#who-invented-the-computerhttp:// invented-the-computer#who-invented-the-computer

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

cosc175 - lec15 Software Systems Software –Operating System – software that controls overall operation of computer –DOS, Windows, Unix, Linux Programming Environment –Editor/Compiler/Interpreter/Linker/ Debugger Application Software

cosc175 - lec16 Software Development Life Cycle 1.Define the Problem (Analysis) 2.Design the Solution (Algorithm) 3.Code Solution (Program) 4.Test and Debug 5.Maintain & Document

SDLC cosc175 - lec17

8 1. Analysis  What?  Defining the Problem  Requirements  Generate and document a clear problem statement  Need to talk to all stakeholders  Most common cause of software system failure traced to poor requirements gathering  IPO

cosc175 - lec19 2. Design HOW? Planning Algorithm – expansion of steps in the IPO diagram Flowchart Pseudocode

cosc175 - lec110 Start Input payRate Input hrsWorked netPay = payRate * hrsWorked Output netPay Stop Pseudocode: Input payRate Input hrsWorked netPay = payRate * hrsWorked Output netPay

Design tools cosc175 - lec111 pseudocodeflowchart Can be done easily on word processor Implements structured design elements well Not visual No standard Standardized visual Difficult to modify requires special software to do on computer

cosc175 - lec112 An Algorithm is... Step-by-step procedures for solving a problem in a finite amount of time. We are learning to write algorithms and the computer is simply a fast and flexible tool for implementing algorithms. An algorithm is an ordered set of instructions such that: (1) There are a finite number of steps. (2) It takes a finite amount of time to execute the steps. (3) Each step is precise in meaning, and “doable.” (4) It solves a general class of problems.

cosc175 - lec Code the Solution Choose language Edit – create source program Compile - translate –Syntax error – violate rules of programming language Link Create an executable program

cosc175 - lec Test and Debug Test with variety of data Debugging: locating and correcting errors –Logic error or bug - flaw in algorithm Run-time error e.g. Divide by zero Programming packages usually have debugger software to help programmer

cosc175 - lec Maintain and Document Maintenance – Changing and maintaining existing programs –Most coding is actually maintenance Documentation – sometimes done by technical writers

cosc175 - lec116 A Tempting Shortcut? GOAL THINKING CODE REVISE DEBUG TEST CODE Shortcut?

cosc175 - lec117 Programming Languages Definition: languages with strict grammar rules, symbols, and words used to construct a computer program Machine Languages –is not portable, runs only on 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 Assembly Language –Mnemonic codes are used for the op. codes instead of binary, EXA: LDA N, SUB B –assembly language program must be translated into machine language before it can be executed, ‘assembler’. High Level Languages –portable –similar to natural language –Requires compiler – translates high-level language into machine code – FORTRAN, Visual BASIC, COBOL, Pascal, Ada, C++, Java – most are standardized by ISO/ANSI

cosc175 - lec118

Assembly Language cosc175 - lec119

cosc175 - lec120 C : C created by Dennis Ritchie at Bell Labs => 90% of UNIX is then written in C 1983: C++ - Bjarne Stroustrup at Bell Labs 1998 : ISO/ANSI standardization of C++ general-purpose programming language - many uses Flexible - few restrictions high demand for C,C++ programmers high level/low level Portable - leader in portability programmer oriented-"written by a professional programmer for professional programmers"

cosc175 - lec Edit: write and type the program (source code) in C++, Save as myProg.cpp 2: Compile: translate the source code into machine language => myprog.obj syntax error – violation of the rules of the language. 3: Link = bring in other code from libraries, bind the modules together, etc => myProg.exe 4: Run = run the executable file Logic errors (bug) – An error caused by a mistake in programming instructions.A logic error causes a program to operate wrongly or produce incorrect data, but not to stop working

cosc175 - lec122 Structured Programming  Top-down Design– divide and conquer  Modularity  subprograms  Stepwise refinement  The Structure Theorem- Use 3 basic control structures to solve any problem  Sequence  Selection (if-then-else)  Repetition (loop)

cosc175 - lec123 SEQUENCE Statement Display “Enter Name” Input name Display “Hello “ name

cosc175 - lec124 SELECTION (branch) IF Condition THEN Statement1 ELSE Statement2 Statement1 Statement Statement2 Condition... True False If (num > 0) Display “Positive” Else Display “Negative”

cosc175 - lec125 LOOP (repetition) Statement Condition... False True WHILE Condition DO Statement1

cosc175 - lec126 SUBPROGRAM (function) SUBPROGRAM1... SUBPROGRAM1 a meaningful collection of SEQUENCE, SELECTION, LOOP, SUBPROGRAM

cosc175 - lec127 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

cosc175 - lec128 As proposed by the project sponsor. As specified in the project request. As designed by the senior analyst. As produced by the programmers. As installed at the user's site.What the user wanted.

cosc175 - lec129 Step 1:Analysis Define the Problem IPO 1. Input: Determine what is given =>nouns, adjectives 2. Output: Determine what is required =>nouns, adjectives 3. Processing: Determine the transformations needed,actions needed to produce the required output =>verbs, adverbs

cosc175 - lec130 variables Input and output data Nouns Naming convention –No spaces –Meaningful names –Usually begin with lowercase –Examples: roomWidth, numPeople, studentName

cosc175 - lec131 Example 1 Read three numbers, add them together and print the total.

cosc175 - lec Identify inputs Underline nouns Read three numbers, add them together and print the total. Break up several values into separate variables

cosc175 - lec Identify inputs fill Input column first Read three numbers, add them together and print the total. Break up several values into separate variables

cosc175 - lec Identify outputs output column next Read three numbers, add them together and print the total. Break up several values into separate variables No verbs here

cosc175 - lec Processing-Define processing steps by bolding verbs Read three numbers, add them together and print the total.

cosc175 - lec136 Each verb is a process step Read three numbers, add them together and print the total. Hint: Usually follows: input, process, output

cosc175 - lec137 Step 3: define list of actions Read three numbers, add them together and print the total. Hint: Use verbs these steps usually involve the input and output defined in step 1

cosc175 - lec138 Example 2: Write a program to prompt the operator for the maximum and minimum temperature readings on a particular day, accept those readings as integers, and calculate and display on the screen the average temperature.

cosc175 - lec139 Example 2: Write a program to prompt the operator for the maximum and minimum temperature readings on a particular day, accept those readings as integers, and calculate and display on the screen the average temperature.

cosc175 - lec140 Example 2: Write a program to prompt the operator for the maximum and minimum temperature readings on a particular day, accept those readings as integers, and calculate and display on the screen the average temperature.