An Introduction to Programming with C++ Sixth Edition

Slides:



Advertisements
Similar presentations
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Advertisements

Lecture 1: Overview of Computers & Programming
Chapter 1 - An Introduction to Computers and Problem Solving
Introduction to Programming
زبانهای برنامه سازی برنامه سازی پیشرفته ارائه دهنده دکتر سيد امين حسيني E.mail: Home page:
PROGRAMMING Introduction To Programming Definition Types Of Programming Languages Programming Language Paradigm Translator
McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 14 Programming and Languages.
Computer Concepts 5th Edition Parsons/Oja Page 546 CHAPTER 11 Software Engineering Section A PARSONS/OJA Computer Programming.
Computers: Tools for an Information Age
Chapter 16 Programming and Languages: Telling the Computer What to Do.
An Introduction to Programming with C++ Fifth Edition Chapter 1 An Introduction to Programming.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Programming and Languages Chapter Competencies (Page 1 of 2) Describe the six steps of programming Discuss design tools including top-down design,
McGraw-Hill Technology Education © 2006 by the McGraw-Hill Companies, Inc. All rights reserved CHAPTER PROGRAMMING AND LANGUAGES.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Chapter 3 Planning Your Solution
Intro to Programming CST JavaScript. Objectives Define software Identify the different types of software Differentiate the different types of programming.
Your Interactive Guide to the Digital World Discovering Computers 2012.
© Paradigm Publishing Inc Chapter 12 Programming Concepts and Languages.
Chapter 11 Information System Development and Programming Languages.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Introduction to High-Level Language Programming
Overview-An Overview of Visual Basic.NET1 An Overview of Visual Basic.NET.
Programming Languages CPS120: Introduction to Computer Science Lecture 5.
Chapter 1 An Overview of Computers and Programming Languages.
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
Microsoft Visual Basic 2005: Reloaded Second Edition
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Computer Programming TCP1224 Chapter 2 Beginning the Problem-Solving Process.
Copyright©2008 N.AlJaffan®KSU1 Chapter 11 Information system development and programming language.
Programming Languages 1.07a.  A computer program is a series of instructions that direct a computer to perform a certain task.  A programming language.
Discovering Computers 2009 Chapter 13 Programming Languages and Program Development.
CSC425 - Introduction To Computer Programming 1. 2 Generation Of Programming Languages A set of rules that telling a computer what to do. There are over.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Software Basics. Some Pioneers Charles Babbage Analytical Engine Countess Ada Lovelace First Programmer ? John Von Neumann storing instructions in memory.
Basic of Programming Language Skill Area Computer System Computer Program Programming Language Programmer Translators.
An Introduction to Programming with C++ Sixth Edition Chapter 7 The Repetition Structure.
Copyright © Prentice Hall Programming and Languages Chapter 14 Telling the Computer What to Do.
Chapter 1: An Introduction to Control Structures Introduction to Programming with C++ Fourth Edition.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 2 I Am Not a Control Freak!
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
What is Programming? A program is a list of instructions that is executed by a computer to accomplish a particular task. Creating those instructions is.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
Programming and Languages
Microsoft Visual Basic 2010: Reloaded Fourth Edition Overview An Introduction to Programming.
1.
Programming in C++ Dale/Weems/Headington Chapter 1 Overview of Programming and Problem Solving.
CSC1200 INTRODUCTION TO PROGRAMMING Dr. Maureen Markel
Structured Programming (4 Credits)
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
5.0 PROGRAMMING Duration: 10 weeks Prepared by Ong Lay Peng Copyright © 2007.
1 Chapter 1 Programming Languages Evolution of Programming Languages To run a Java program: Java instructions need to be translated into an intermediate.
Overview.ppt Overview-An Overview of Visual Basic.NET An Overview of Visual Basic.NET.
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
Programming and Languages Dept. of Computer and Information Science IUPUI.
Course Instructor: Hira Farman Course : BY:HIRA FARMAN.
LESSON 1 Introduction to Programming Language. Computer  Comprised of various devices that are referred to as HARDWARE.  The computer programs that.
Chapter 1 An Overview of Computers and Programming Languages.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
Software Engineering Algorithms, Compilers, & Lifecycle.
Your Interactive Guide to the Digital World Discovering Computers 2012 Chapter 13 Computer Programs and Programming Languages.
CIS 365: Visual Application Development Introduction to Computers and Programming.
Introduction to Programming in C++ Seventh Edition Chapter 1: An Introduction to Programming.
CSCI-235 Micro-Computer Applications
An Introduction to Control Structures
An Introduction to Control Structures
An Introduction to Programming with C++ Fifth Edition
Presentation transcript:

An Introduction to Programming with C++ Sixth Edition Chapter 1 An Introduction to Programming

Objectives Define the terminology used in programming Explain the tasks performed by a programmer Describe the qualities of a good programmer Understand the employment opportunities for programmers and software engineers Explain the history of programming languages An Introduction to Programming with C++, Sixth Edition

Objectives (cont’d.) Explain the sequence, selection, and repetition structures Write simple algorithms using the sequence, selection, and repetition structures An Introduction to Programming with C++, Sixth Edition

Programming a Computer Programs are the directions given to computers Programmers are the people who write computer programs Programming Languages enable programmers to communicate with the computer Popular languages: C++, Visual Basic, C#, Java How are these languages used commercially? An Introduction to Programming with C++, Sixth Edition

The Programmer’s Job Programmers help solve computer problems Employee or freelance Typical steps involved Meet with user to determine problem Convert the problem into a program Test the program Provide user manual An Introduction to Programming with C++, Sixth Edition

Do I Have What It Takes to Be a Programmer? Qualities employers look for Logical and analytical thinking Close attention to detail Patience and persistence Ingenuity and creativity Good communication skills: technical and nontechnical Business skills (for managerial positions) An Introduction to Programming with C++, Sixth Edition

Employment Opportunities Computer software engineer: designs an appropriate solution to a user’s problem Computer programmer: codes a computer solution Coding is the process of translating a computer solution into a language a computer can understand Some positions call for both engineering and programming An Introduction to Programming with C++, Sixth Edition

A Brief History of Programming Languages Enable programmer to communicate with computer Different types Machine languages Assembly languages High-level languages An Introduction to Programming with C++, Sixth Edition

Machine Languages The first programmers had to write the program instructions using only combinations of 0s and 1s Example: 00101 10001 10000 Instructions written in 0s and 1s are called machine language or machine code Each type of machine has its own language Machine languages are the only way to communicate directly with the computer Programming in machine language: tedious and error-prone; requires highly trained programmers An Introduction to Programming with C++, Sixth Edition

Assembly Languages Assembly languages simplify programmer’s job Can use mnemonics instead of 0s and 1s Example: ADD bx, ax Assembly programs require an assembler to convert instructions into machine code Easier to write programs in assembly language But still tedious and requires highly trained programmers An Introduction to Programming with C++, Sixth Edition

High-Level Languages High-level languages allow programmer to use English-like instructions Example: grossPay = hours * rate High-level languages are more machine independent Programs written in a high-level language can be used on many different types of computers Compilers translate high-level instructions into 0s and 1s (machine language) Interpreters translate the program line by line as the program is running An Introduction to Programming with C++, Sixth Edition

High-Level Languages (cont’d.) When writing a procedure-oriented program, the programmer concentrates on the major tasks that the program needs to perform Examples: COBOL, BASIC, C An object-oriented program requires programmer to focus on the objects that the program can use to accomplish its goal Examples: C++, Visual Basic, Java, C# Object-oriented programs allow for better code-reuse An object can be used in more than one program An Introduction to Programming with C++, Sixth Edition

Control Structures Programs are written using three basic structures Sequence Used in every program you write Repetition Used in most programs you write Selection These are called control structures or logic structures An Introduction to Programming with C++, Sixth Edition

The Sequence Structure The sequence structure directs the computer to process the program instructions, one after another, in the order listed in the program An algorithm is a set of step-by-step instructions that accomplish a task Example: following a recipe to make cookies An Introduction to Programming with C++, Sixth Edition

The Sequence Structure (cont’d.) Figure 1-1 An example of the sequence structure An Introduction to Programming with C++, Sixth Edition

The Selection Structure Selection structure: makes a decision and then takes an appropriate action based on that decision Also called the decision structure Example: waiting or crossing at railroad tracks depending on signal lights An Introduction to Programming with C++, Sixth Edition

The Selection Structure (cont’d.) Figure 1-2 An example of the selection structure An Introduction to Programming with C++, Sixth Edition

The Selection Structure (cont’d.) Figure 1-3 Another example of the selection structure An Introduction to Programming with C++, Sixth Edition

The Repetition Structure Repetition structure: directs computer to repeat one or more instructions until some condition is met Also called a loop or iteration Figure 1-4 Modified algorithm showing the repetition structure An Introduction to Programming with C++, Sixth Edition

The Repetition Structure (cont’d.) What could you do if you don’t know precisely how many steps separate Robin from the boxes? Figure 1-5 Algorithm showing the modified condition in the repetition structure An Introduction to Programming with C++, Sixth Edition

Summary Programs are step-by-step instructions that tell a computer how to perform a task Programmers use programming languages to communicate with the computer First programming languages were machine languages: 0s and 1s (machine code) Next came assembly languages, which allowed for mnemonics High-level languages can be used to create procedure-oriented programs or object-oriented programs An Introduction to Programming with C++, Sixth Edition

Summary (cont’d.) Algorithm: step-by-step instructions that accomplish a task (not written in a programming language) Algorithms contain one or more of the following control structures: sequence, selection, and repetition Sequence structure: process the instructions, one after another, in the order listed Selection structure: directs the computer to make a decision and then to select an appropriate action based on that decision Repetition structure: repeat one or more instructions until some condition is met An Introduction to Programming with C++, Sixth Edition

YOUR Assignments – Lab 1-1: Stop and Analyze A local business employs five salespeople and pays a 3% bonus on a salesperson’s sales Your task is to create a program that calculates the amount of each salesperson’s bonus The program should print each salesperson’s name and bonus amount An Introduction to Programming with C++, Sixth Edition

YOUR Assignments – Lab 1-2: Plan and Create Using only the instructions shown below, create an algorithm that shows the steps an instructor takes when grading a test that contains 25 questions An Introduction to Programming with C++, Sixth Edition

YOUR Assignments – Lab 1-3: Modify Modify the algorithm shown in Lab 1-1 so that it gives a 3.5% bonus to salespeople selling more than $2,000 All other salespeople should receive a 3% bonus An Introduction to Programming with C++, Sixth Edition

Your Assignments - Labs – Lab 1 – Stop and Analyze Lab 2 - Plan and Create Lab 3 – Modify Review Questions – pages 13-15 Chapter 1 – Exercises – Pages 15-19 An Introduction to Programming with C++, Sixth Edition