CS 13011 CS 13012 CS IA: Procedural Programming CS IB: Object-Oriented Programming.

Slides:



Advertisements
Similar presentations
COSC 120 Computer Programming
Advertisements

Your First C++ Program Aug 27, /27/08 CS 150 Introduction to Computer Science I C++  Based on the C programming language  One of today’s most.
Chapter 1 Introduction to Computers and C++ Programming.
Wednesday, 9/4/02, Slide #1 1 CS 106 Intro to CS 1 Wednesday, 9/4/02  Today: Introduction, course information, and basic ideas of computers and programming.
Three types of computer languages
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Sixth Edition by Tony Gaddis, Judy Walters,
1 Key Concepts:  Why C?  Life Cycle Of a C program,  What is a computer program?  A program statement?  Basic parts of a C program,  Printf() function?
Chapter 1 Introduction to C Programming. 1.1 INTRODUCTION This book is about problem solving with the use of computers and the C programming language.
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Topic 1: Introduction to Computers and 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.
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: INTORDUCTION TO C LANGUAGE
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
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 © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Introduction to Computers and C++ Programming.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
Hello World 2 What does all that mean?.
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.
Instructor: Tina Tian. About me Office: RLC 203A Office Hours: Wednesday 1:30 - 4:30 PM or .
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 1 Introduction to Computers and C++ Programming.
Copyright © 2015 Pearson Education, Ltd.. All rights reserved. Chapter 1 Introduction to Computers and C++ Programming.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Introduction to Computers and C++ Programming.
Programming With C.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 1 Introduction to Computers and C++ Programming.
Copyright © 2015 Pearson Education, Ltd.. All rights reserved. Chapter 1 Introduction to Computers and C++ Programming.
Mohamed Iqbal Pallipurath Slide 1. Mohamed Iqbal Pallipurath Slide 2 Basics Introduction to Computers and C++ Programming.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 1- 1 October 20, October 20, 2015October 20, 2015October 20,
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
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?
Liang, Introduction to C++ Programming, (c) Chapter 1 Introduction to Computers, Programs, and C++
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?
Copyright © 2012 Pearson Addison-Wesley. All rights reserved. Chapter 1 Introduction to Computers and C++ Programming.
CS Computer Science I. BCPL was developed in 1967 as a language for writing operating systems and software compilers In 1970, the creators of the.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 1 Introduction to Computers and C++ Programming.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Brief Version of Starting Out with C++ Chapter 1 Introduction to Computers and Programming.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
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.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Software Engineering Algorithms, Compilers, & Lifecycle.
By Kundang K Juman Hardware & Software. COMP102 Prog. Fundamentals I: Software / Slide 2 l Four components of a computer system: n CPU - central processing.
Introduction to Programming By: Prof. Muhammad Abu Baker Siddique 2 nd Lecture 1.
Computer Basics.
Foundations of Computer Science C & C++ programming lecture 2
Introduction to Computers and C++ Programming
Computer Terms Review from what language did C++ originate?
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Hello World 2 What does all that mean?.
Computers: Hardware and Software
CS IA: Procedural Programming CS IB: Object-Oriented Programming
Computer Terms Review from what language did C++ originate?
Presentation transcript:

CS CS CS IA: Procedural Programming CS IB: Object-Oriented Programming

l BCPL was developed in 1967 as a language for writing operating systems and software compilers l In 1970, the creators of UNIX operating system needed a high- level language that provided enough power and flexibility for their task. They developed B (a derivative of BCPL) l In 1972, an enhanced and improved version of the language called C was used to code most of UNIX l most of operating systems (one of the largest and most complicated pieces of software) is written in C or C++ n source code for Microsoft Windows Vista contains 50 million lines of mostly C/C++ code n source code Red Hat Linux v.7.1 contains 30 million lines of C/C++ code Where did C++ come from? 2

l C++ is an extension of C developed by Bjarne Stroustrup in early 1980s l C/C++ are possibly the most popular programming languages in use today l C++ absorbed the best features of C and made a few additions to make it even more powerful and convenient to use n C was written to combine ease of high-level language with the power of low-level language –with C it is very easy to write code that is difficult to understand and hard to debug n one of the major additions introduced by C++ is the use of OBJECTS! The Birth of C++ 3

l program - set of instructions to computer l software - collection of programs l hardware - physical devices that make up computer equipment l computer - PC/mainframes/workstations l computer contains 5 main components n CPU - follows the instructions and performs calculations specified by the program n input device - any device that allows outside world to communicate information to the computer n output device - any device that allows computer to communicate information to the outside world n main memory/RAM - a list of addressable numbered memory locations that computer can operate upon –bit - the least possible amount of information: 0 or 1 –byte - 8 bits –memory location - single (indivisible) portion of memory that holds data –address - number that identifies a memory location n secondary memory - memory that is used for keeping a permanent record of information - disks/data CDs/flash drives Hardware 4

Hardware Diagrams 5

l operating system - allocates computer resources, launches other programs and makes sure they work properly l program (again) - set of instructions for computer to follow l data - input to the program l running/executing program - performing program instructions on given data l natural language - language used by humans l high-level language - language (close to natural) that is understood by humans, C++ is a high-level language low-level language (assembly) - a list of instructions a computer can follow : add X, Y, Z l machine language - list of instructions in binary format a computer understands l compiler - a program that translates high-level language into low-level language l code - source (high-level language), object (low-level language) l library - set of previously developed routines l linker - program that takes object code, adds needed routines from libraries and produces executable code l executable code - can run on computer Software 6

Software Cycle Diagam add include files executable code source code (add1.cpp) check file unit for legal syntax and compile it into an object code link object code with pre-compiled routines from standard libraries to produce executable code include files (add1.h, iostream) done by compiler object code (add1.o) standard libraries done by linker 7

l include directive - tells compiler where to find certain items about the program main part (main function) - contain instructions for computer, starts and ends with braces: {} l statement – single unit of execution each statement is ended with semicolon ; l program consists of a sequence of statements l comment is a portion of line ignored by compiler - serves to make the code easier to understand by humans l breaks and indentation is for humans - compiler ignores them. Yet the program should be easy to read! C++ Program Layout #include int main() { statement 1; // comment statement 2;... } 8

// displays a greeting // Mikhail Nesterenko // 8/25/2013 #include using std::cout; using std::endl; int main() { cout << "Hello, World!" << endl; } First Program: helloWorld.cpp preprocessor directive output statement comments function named main() indicates start of program

Rules of Programming l syntax - the principles of constructing (structuring) the program l semantics – the meaning of the program and its parts style – non-syntactic rules of program writing aimed at making program easier to read and understand 10