CS102 Introduction to Computer Programming

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 of Programming and Problem Solving ROBERT REAVES.
Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming.
COSC 120 Computer Programming
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Computers: Tools for an Information Age
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Sixth Edition by Tony Gaddis, Judy Walters,
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
CS 115 Chapter 1 Overview of Programming and Problem Solving.
Introduction to Computers and Python. What is a Computer? Computer- a device capable of performing computations and making logical decisions at speeds.
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.
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.
Why Program? Computer – programmable machine designed to follow instructions Program – instructions in computer memory to make it do something Programmer.
Chapter Introduction to Computers and Programming 1.
Introduction to Programming Dr Masitah Ghazali Programming Techniques I SCJ1013.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Topics Introduction Hardware and Software How Computers Store Data
INTRODUCTION TO COMPUTING
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
COP1220/CGS2423 Introduction to C++/ C for Engineers Professor: Dr. Miguel Alonso Jr. Fall 2008.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
CISC105 General Computer Science Class 1 – 6/5/2006.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 1 Introduction to Computers and Programming.
Overview of Programming and Problem Solving Textbook Chapter 1 1.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
An Object-Oriented Approach to Programming Logic and Design Chapter 1 An Overview of Computers and Logic.
Computer Architecture
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
Computer Basic Vocabulary
Chapter 1 : Overview of Computer and Programming By Suraya Alias
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
Brief Version of Starting Out with C++ Chapter 1 Introduction to Computers and Programming.
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. Introduction to Computers and Computing.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
Chapter 1: Introduction to Computers and Programming.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
INTRODUCTION TO COMPUTERS. A computer system is an electronic device used to input data, process data, store data for later use and produce output in.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming
BASIC PROGRAMMING C SCP1103 (02)
An Overview of the Computer System
Chapter 1: An Overview of Computers and Programming Languages
Topics Introduction Hardware and Software How Computers Store Data
CSCI-235 Micro-Computer Applications
Chapter 1: An Overview of Computers and Programming Languages
BASIC PROGRAMMING C SCP1103 (02)
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Chapter 1. Introduction to Computers and Programming
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Looking Inside the machine (Types of hardware, CPU, Memory)
Chapter 1: Introduction to Computers and Programming
An Overview of the Computer System
Topics Introduction Hardware and Software How Computers Store Data
ICS103 Programming in C 1: Overview of Computers And Programming
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

CS102 Introduction to Computer Programming Week 1 Introduction and Chapter 1

Chapter 1 Intro to Programming and Program Design Why Program? Computer Systems : Hardware and Software Programs and Programming Languages What is a Program Made of? Input, Processing and Output The Programming Process Procedural and Object-Oriented Programming

Why Program? Computers perform a wide variety of tasks. Computer programmers provide the software for computers. Software transforms a general purpose computer into a specialized tool. Concept - Computers can do many different jobs because they are programmable.

What is Programming? Computers are designed to execute a set of instructions. Programming is the act of creating a set of instructions for a computer to execute. A set of instructions that performs a specific task is called an algorithm. Concept - A program is a set of instructions that a computer follows in order to perform a task.

Concept – Make a general purpose machine perform a specific task. What a programmer does A programmer creates the following things: The logical flow of the instructions The mathematical procedures The appearance of the screens The way information is presented to the user The program's user friendliness Manuals and other forms of written documentation Concept – Make a general purpose machine perform a specific task.

Computer Systems : Hardware and Software Central Processing Unit Main Memory Secondary Storage Input Devices Output Devices Software : loaded from a secondary storage device into main memory Computer CPU Input Device Output Device Main Memory Secondary Storage

Central Processing Unit The CPU consists of two parts Control Unit Performs three functions Fetch Decode Execute Arithmetic & Logic Unit Performs math operations Add Shift And Or Concept - The CPU is the heart of the computer.

Main Memory Referred to as: Holds the program during execution Random Access Memory (RAM) Static or dynamic Volatile Read Only Memory (ROM) Non-volatile Holds the program during execution Divided into equal sections called cells Each cell has a unique address

Secondary Storage Used to store programs and data for long periods of time: Hard Drives Floppy Zip Drives Categorized by speed and capacity Digital Tape CD ROMS Flash Memory Cards

Input Devices Provide data to the CPU to be processed: Keyboards Touch sensitive screens Secondary storage devices Provide information in a variety of formats: Some conform to standards. Some are application unique. Microphones Cameras Scanners

Output Devices Displays or stores data for the user: Monitors Printers Speakers Consider the complexity of multimedia output. Disk Drives Modems Servers

Concept – Software connects the user to the machine The instructions that tell the computer and all of its devices what to do. When and what data to get What and how to manipulate the data When and how to provide it to the user Concept – Software connects the user to the machine

Programming Languages Computers use machine language consisting of numbers only. Humans have difficulty communicating purely in numbers. A programming language provides a way for humans to communicate with a computer Concept - A program language is a special language used to write computer instructions.

Some Popular Programming Languages BASIC Beginners All-purpose Symbolic Instruction Code. A general programming language originally designed to be simple enough for beginners to learn. FORTRAN Formula Translator. A language designed for programming complex mathematical algorithms. COBOL Common Business-Oriented Language. A language designed for business applications. Pascal A structured, general purpose language designed primarily for teaching programming. C A structured, general purpose language developed at Bell Labs. C offers both high-level and low-level features. C++ Based on the C language, C++ offers object-oriented features not found in C. Also invented at Bell Laboratories. Java An object-oriented language invented at Sun Microsystems. Java may be used to develop programs that run over the Internet, in a web browser.

The Importance of C++ C++ is based on the C programming language. C++ is a midlevel language containing both high level and low level instructions. C++ is portable meaning that a C++ program can run a wide range of computers. Concept - The popularity of C++ makes it an important language to learn.

Code Source Code Modified Source code Object Code Executable Code Text written by the programmer. Modified Source code Expanded text produced by the Pre-processor. Object Code Machine level code generated by the compiler. Executable Code Machine level code generated by the linker. Source Code Pre-processor Modified Source Code Compiler Object Code Linker Executable Code

What is a Program Made of? Language Description Element Key Words Words that have a special meaning. Key words may only be used for their intended purpose. Programmer Words or names defined by the programmer. They are Defined symbolic names that refer to variables or programming Symbols routines. Operators Operators perform operations on one or more operands. An operand is usually a piece of data, like a number. Punctuation Punctuation characters mark the beginning or ending of a statement, or separate items in a list. Syntax Rules followed when constructing a program. Syntax dictates how key words and operators may be used, and where punctuation symbols must appear. Concept - There are certain elements common to all computer programming languages.

Concept - Programs are made of a complete statements. Lines and Statements A line is one single line of program text A statement is: A complete instruction that causes the computer to perform some action May consist of more than one line A C++ statement must end in a semicolon (;) Concept - Programs are made of a complete statements.

Concept - A program stores information in variables. Symbolic names that represent locations in the computer’s Random Access M Used to reference information that may change throughout the execution of a program The name of a variable should reflect the purpose of the data it references Concept - A program stores information in variables.

Variable Declarations Variables are either numbers or characters A variable declaration statement informs the compiler: the name that will be assigned to the variable how it should be stored in memory it's initial value (optional) A variable definition statement causes a variable to be created in memory. Concept - Variables must be defined before they are used.

Input, Process, and Output A program takes data as input, processes it and returns new data as output: Input usually comes from some external source but can be the output of another process. Output is usually sent to an external device but could be input to another process. A process determines the content of the output. Concept - The three primary activities of a program are input, processing, and output.

The Programming Process 1. Clearly define what the program is to do. 2. Visualize the program running on the computer. 3. Design a flow or Hierarchy chart. 4. Check the chart for logical errors. 5. Write a pseudocode version of the program. 6. Check the pseudocode for errors. 7. Write the actual program on paper. 8. Desk check the program for syntax or logical errors. 9. Enter the code and compile it. 10 . Correct any errors found during compilation. 11. Run the test data for input . 12. Correct any logical errors found while running the program. Concept - There are a number of steps involved in successfully creating a program.

What is Software Engineering? Users Needs Deliver Analyze Maintain Debug Specify Design Code Test Modify Document Concept - Software engineering encompasses the whole process of crafting computer software.

Procedural and Object-Oriented Programming Procedural programming organizes code into functional subroutines that perform specific types of tasks. Object oriented programming addresses the relationships between program features. Concept - Procedural programming and object-oriented programming are two ways of thinking about software development and program design