Chapter 1: An Overview of Computers and Programming Languages

Slides:



Advertisements
Similar presentations
Exercise 2.
Advertisements

Chapter 1 An Overview of Computers and Programming Languages.
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
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.
Chapter 16 Programming and Languages: Telling the Computer What to Do.
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Introduction To C++ Programming 1.0 Basic C++ Program Structure 2.0 Program Control 3.0 Array And Structures 4.0 Function 5.0 Pointer 6.0 Secure Programming.
CHAPTER 1: AN OVERVIEW OF PROGRAMMING INSTRUCTOR: MOHAMMAD MOJADDAM How to Program in C++
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages Updated by: Dr\Ali-Alnajjar.
CHAPTER 1 AN OVERVIEW OF COMPUTERS AND PROGRAMMING LANGUAGES.
Chapter 1: An Overview of Computers and Programming Languages.
Chapter 2: Developing a Program Prelude to Programming Concepts and Design Copyright © 2001 Scott/Jones, Inc.. All rights reserved. 1 Chapter 2 Developing.
Chapter 1 An Overview of Computers and Programming Languages.
EGR 2261 Engineering Problem Solving Using C and C++ Professor Nick Reeder.
Hello World 2 What does all that mean?.
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 1: An Overview of Computers and Programming Languages.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 1: An Overview of Computers and Programming Languages.
Overview of Programming and Problem Solving. Objectives In this chapter you will: Learn about different types of computers Explore the hardware and software.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 1: An Overview of Computers and Programming Languages.
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
N from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data?
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 1: An Overview of Computers and Programming Languages.
CHAPTER 1 INTRODUCTION 1 st Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
1 Original Source : and Problem and Problem Solving.ppt.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 1: An Overview of Computers and Programming Languages.
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
1 Chapter 1 Programming Languages Evolution of Programming Languages To run a Java program: Java instructions need to be translated into an intermediate.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
C++ Programming: Program Design Including Data Structures, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
Chapter 1 An Overview of Computers and Programming Languages.
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.
Software Engineering Algorithms, Compilers, & Lifecycle.
Introduction to Programming By: Prof. Muhammad Abu Baker Siddique 2 nd Lecture 1.
Evolution and History of Programming Languages
Chapter 1 Introduction 2nd Semester H
Introduction to Computers and C++ Programming
Engineering Problem Solving Using C and C++ Professor Nick Reeder
Chapter 1: An Overview of Computers and Programming Languages
Engineering Problem Solving With C An Object Based Approach
Chapter 5- Assembling , Linking, and Executing Programs
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
and Executing Programs
Hello World 2 What does all that mean?.
High Level Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
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: An Overview of Computers and Programming Languages
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Reminders Please turn off cell phones.
Computer Terms Review from what language did C++ originate?
Presentation transcript:

Chapter 1: An Overview of Computers and Programming Languages C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages Updated by: Malak Abdullah

The Evolution of Programming Languages (cont'd.) High-level languages include Basic, FORTRAN, COBOL, Pascal, C, C++, C#, and Java Compiler: translates a program written in a high-level language to machine language Updated by: Malak Abdullah C++ Programming: From Problem Analysis to Program Design, Fifth Edition

Processing a C++ Program #include <iostream> using namespace std; int main() { cout << "My first C++ program." << endl; return 0; } Sample Run: My first C++ program. Updated by: Malak Abdullah C++ Programming: From Problem Analysis to Program Design, Fifth Edition

Processing a C++ Program (cont'd.) To execute a C++ program: Use an editor to create a source program in C++ Preprocessor directives begin with # and are processed by a the preprocessor Use the compiler to: Check that the program obeys the rules Translate into machine language (object program) Updated by: Malak Abdullah C++ Programming: From Problem Analysis to Program Design, Fifth Edition

Processing a C++ Program (cont'd.) To execute a C++ program (cont'd.): Linker: Combines object program with other programs provided by the SDK to create executable code Loader: Loads executable program into main memory The last step is to execute the program Updated by: Malak Abdullah C++ Programming: From Problem Analysis to Program Design, Fifth Edition

Processing a C++ Program (cont'd.) Updated by: Malak Abdullah C++ Programming: From Problem Analysis to Program Design, Fifth Edition

Programming with the Problem Analysis–Coding–Execution Cycle Programming is a process of problem solving One problem-solving technique: Analyze the problem Outline the problem requirements Design steps (algorithm) to solve the problem Algorithm: Step-by-step problem-solving process Solution achieved in finite amount of time Updated by: Malak Abdullah C++ Programming: From Problem Analysis to Program Design, Fifth Edition

The Problem Analysis–Coding–Execution Cycle (cont’d.) Updated by: Malak Abdullah C++ Programming: From Problem Analysis to Program Design, Fifth Edition

The Problem Analysis–Coding–Execution Cycle (cont'd.) Malak Abdullah The Problem Analysis–Coding–Execution Cycle (cont'd.) Run code through compiler If compiler generates errors Look at code and remove errors Run code again through compiler If there are no syntax errors Compiler generates equivalent machine code Linker links machine code with system resources Updated by: Malak Abdullah C++ Programming: From Problem Analysis to Program Design, Fifth Edition

The Problem Analysis–Coding–Execution Cycle (cont'd.) Malak Abdullah The Problem Analysis–Coding–Execution Cycle (cont'd.) Once compiled and linked, loader can place program into main memory for execution The final step is to execute the program Compiler guarantees that the program follows the rules of the language Does not guarantee that the program will run correctly Updated by: Malak Abdullah C++ Programming: From Problem Analysis to Program Design, Fifth Edition

Updated by: Malak Abdullah Example 1-1 Design an algorithm to find the perimeter and area of a rectangle The perimeter and area of the rectangle are given by the following formulas: perimeter = 2 * (length + width) area = length * width Updated by: Malak Abdullah C++ Programming: From Problem Analysis to Program Design, Fifth Edition

Updated by: Malak Abdullah Example 1-1 (cont'd.) Algorithm: Get length of the rectangle Get width of the rectangle Find the perimeter using the following equation: perimeter = 2 * (length + width) Find the area using the following equation: area = length * width Updated by: Malak Abdullah C++ Programming: From Problem Analysis to Program Design, Fifth Edition