Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming.

Slides:



Advertisements
Similar presentations
Designing a Program & the Java Programming Language
Advertisements

CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
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.
CIS105 Chapter 1 Theory Review. Page 2 Hardware and Software are the two major components o any computer system Hardware is the set of physical devices.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Sixth Edition by Tony Gaddis, Judy Walters,
Chapter 2: Input, Processing, and Output
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.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
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.
Programming Logic and Design Fourth Edition, Introductory
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.
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Chapter 1 Introduction to Programming and Visual Basic.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
CS102 Introduction to Computer 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.
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.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
CSE 1340 Introduction to Computing Concepts Class 2.
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.
Chapter 1 Introduction to Computer and Java 1. Contents 1.Introduction 2.Why Program? 3.Computer Systems: Hardware and Software 4.Programming Languages.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition.
S2008Final_part1.ppt CS11 Introduction to Programming Final Exam Part 1 S A computer is a mechanical or electrical device which stores, retrieves,
Introduction to Computer Programming Using C Session 23 - Review.
CS CS Computing for Business Instructor:David Tucker GTA:Batul Mirza.
Overview of Programming and Problem Solving Textbook Chapter 1 1.
An Object-Oriented Approach to Programming Logic and Design Chapter 1 An Overview of Computers and Logic.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
CHAPTER 1 INTRODUCTION 1 st semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Copyright © 2011 Pearson Addison-Wesley What is a Program Made Of? Keywords (Reserved Words) – Words with special meaning that make up a high-level programming.
1 12/4/1435 h Lecture 2 Programs and Programming Languages.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
COP1220/CGS2423 Introduction to C++/ C for Engineers Professor: Dr. Miguel Alonso Jr. Fall 2008.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
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.
Introduction to Computer Programming using Fortran 77.
Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
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 Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
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
Chapter 1 Introduction 2nd Semester H
Introduction to Programming and Visual Basic
1-1 Logic and Syntax A computer program is a solution to a problem.
DDC 1023 – Programming Technique
Chapter 1. Introduction to Computers and Programming
Chapter 1: Introduction to Computers and Programming
Programming Right from the Start with Visual Basic .NET 1/e
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Chapter 2: Input, Processing, and Output
Programming Logic and Design Eighth Edition
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming

Starting Out with C++, 3 rd Edition 2 1.1Why Program? Computers can do many different jobs because they are programmable.

Starting Out with C++, 3 rd Edition 3 1.2Computer Systems: Hardware and Software All computer systems consist of similar hardware devices and software components. This section provides an overview of standard computer hardware and software organization.

Starting Out with C++, 3 rd Edition 4 Hardware 1.The CPU 2.Main Memory 3.Secondary Storage 4.Input Devices 5.Output Devices

Starting Out with C++, 3 rd Edition 5 Input Device Central Processing Unit Main Memory Output Device Output Device Figure 1.1

Starting Out with C++, 3 rd Edition 6 Figure 1.2 Arithmetic and Logic Unit Control Unit Instruction (Input) Result (Output)

Starting Out with C++, 3 rd Edition 7 Software –Operating Systems Single tasking Multi-tasking –Application Software

Starting Out with C++, 3 rd Edition 8 1.3Programs and Programming Languages What is a program? –A set of instructions a computer follows in order to perform a task. A programming language is a special language used to write computer programs.

Starting Out with C++, 3 rd Edition 9 Program 1-1 // This program calculates the user’s pay. #include void main(void) { float hours, rate, pay; cout << “How many hours did you work? ”; cin >> hours; cout << “How much do you get paid per hour? ”; cin >> rate; pay = hours * rate; cout << “You have earned $” << pay << endl; }

Starting Out with C++, 3 rd Edition 10 Program Output How many hours did you work? 10 How much do you get paid per hour? 15 You have earned $150

Starting Out with C++, 3 rd Edition 11 Programming Languages High level (Close to Human Language) Low level (Machine Language) Figure 1-4

Starting Out with C++, 3 rd Edition 12 Table 1-1

Starting Out with C++, 3 rd Edition What is a Program Made of? There are certain elements that are common to all programming languages. –Key Words –Programmer-Defined Symbols –Operators –Punctuation

Starting Out with C++, 3 rd Edition 14 Language Elements, Table 1-2

Starting Out with C++, 3 rd Edition 15 Lines and Statements cout << “How many hours did you work?”;

Starting Out with C++, 3 rd Edition 16 Variables A storage location in the computer’s memory for holding a piece of information. Symbolic names that represent locations in the computer’s random-access memory.

Starting Out with C++, 3 rd Edition 17 Variable Declarations Two types of information: numbers and characters Numbers may be integers or floating-point numbers The statement below creates three variables in memory named hours, rate, and pay that each can store a floating point number float hours, rate, pay;

Starting Out with C++, 3 rd Edition Input, Processing, and Output Input: cin >> hours; Processing: pay = hours * rate; Output cout<<“You have earned $”<<pay;

Starting Out with C++, 3 rd Edition The Programming Process The programming process consists of several steps, which include design, creation, testing and debugging activities.

Starting Out with C++, 3 rd Edition 20 Designing and Creating a Program 1. Clearly define what the program is to do 2. Visualize the program running on the computer. 3. Design a flowchart or hierarchy chart 4. Check the flowchart or hierarchy chart for logical errors.

Starting Out with C++, 3 rd Edition 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 errors. 9. Enter the code and compile it. 10. Correct any errors found during compilation. Repeat steps 9 and 10 as many times as necessary.

Starting Out with C++, 3 rd Edition Run the program with test data for input. 12.Correct any errors found while running the program. Repeat steps 9 through 12 as many times as necessary. 13.Validate the results of the program.

Starting Out with C++, 3 rd Edition Procedural and Object-Oriented Programming Procedural programming and object- oriented programming are two ways of thinking about software development and program design.