Chapter 1. Introduction to Computers and Programming

Slides:



Advertisements
Similar presentations
CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
Advertisements

LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
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.
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,
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
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.
Computers & Logic An Overview. Hardware Hardware is the equipment, or the devices, associated with a computer. For a computer to be useful, however, it.
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.
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.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
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.
Control Structures (B) Topics to cover here: Sequencing in C++ language.
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.
Senem KUMOVA METİN // Fall CS 115 Introduction to Programming Introduction to Computing.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
Ch 1 - Introduction to Computers and Programming Hardware Terminology Main Memory Auxiliary Memory Drives Writing Algorithms Using Pseudocode Programming.
Brief Version of Starting Out with C++ Chapter 1 Introduction to Computers and Programming.
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.
Chapter 1 Introduction to Programming and Visual Basic.
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
BASIC PROGRAMMING C SCP1103 (02)
Microsoft Imagine All KU students currently enrolled in a CS class are eligible to receive Microsoft software, including Operating Systems development.
Introduction to Programming and Visual Basic
1-1 Logic and Syntax A computer program is a solution to a problem.
Completing the Problem-Solving Process
BASIC PROGRAMMING C SCP1103 (02)
DDC 1023 – Programming Technique
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: Introduction to Computers and Programming
IPC144 Introduction to Programming Using C Week 2 – Lesson 1
Introduction to the C Language
Unit 1: Introduction Lesson 1: PArts of a java program
Topics Introduction Hardware and Software How Computers Store Data
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)
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:

Chapter 1. Introduction to Computers and Programming

1.1 Why Program? Computers can do many different jobs because they are programmable.

1.2 Computer 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.

Hardware The CPU Main Memory Secondary Storage Input Devices Output Devices

Figure 1.1 Central Processing Input Unit Device Output Device Main Memory Output Device

Arithmetic and Logic Unit Figure 1.2 Instruction (Input) Arithmetic and Logic Unit Result (Output) Control Unit

Software Operating Systems Application Software Single tasking Multi-tasking Application Software

1.3 Programs 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.

Program 1-1 // This program calculates the user’s pay. #include <iostream.h> 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.precision(2); cout.setf(ios::fixed | ios::showpoint); cout << “You have earned $” << pay << endl; }

Program Output How many hours did you work? 10 How much do you get paid per hour? 15 You have earned $150.00

Programming Languages Figure 1-4 High level (Close to Human Language) Low level (Machine Language)

Table 1-1

1.4 What is a Program Made of? There are certain elements that are common to all programming languages. Key Words Programmer-Defined Symbols Operators Punctuation

Language Elements, Table 1-2

Lines and Statements cout << “How many hours did you work?”;

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.

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;

1.5 Input, Processing, and Output cin >> hours; Processing: pay = hours * rate; Output cout<<“You have earned $”<<pay;

1.6 The Programming Process The programming process consists of several steps, which include design, creation, testing and debugging activities.

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 hierarchy chart 4. Check the hierarchy 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 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.

11. 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.

1.7 Procedural and Object-Oriented Programming Procedural programming and object-oriented programming are two ways of thinking about software development and program design.