1 ENG236: Introduction (1) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.

Slides:



Advertisements
Similar presentations
EC-111 Algorithms & Computing Lecture #1 Instructor: Jahan Zeb Department of Computer Engineering (DCE) College of E&ME NUST.
Advertisements

Lecture 1: Overview of Computers & Programming
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Systems Software.
Programming Creating programs that run on your PC
Computer Concepts 5th Edition Parsons/Oja Page 546 CHAPTER 11 Software Engineering Section A PARSONS/OJA Computer Programming.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Computers: Tools for an Information Age
Introduction to Computer Programming CSC 1401: Introduction to Programming with Java Lecture 2 Wanda M. Kunkle.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 1: Getting Started by George Lamperti & BU Faculty.
© Prentice Hall CHAPTER 3 Computer Software.
An Introduction to Programming with C++ Fifth Edition Chapter 1 An Introduction to Programming.
CS 104 Introduction to Computer Science and Graphics Problems Software and Programming Language (2) Programming Languages 09/26/2008 Yang Song (Prepared.
Chapter 3 Software Two major types of software
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Introduction to Programming G50PRO University of Nottingham Unit 1 : Introduction Paul Tennent
1 Chapter-01 Introduction to Computers and C++ Programming.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Introduction to Computer Programming itc-314
“C” Programming Language What is language ? Language is medium of communication. If two persons want to communicate with each other, they have to use.
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
CS2303 C14 Systems Programming Concepts Bob Kinicki.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
CSC141 Introduction to Computer Programming
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Programming 1 1. Introduction to object oriented programming and problem-solving.
An Introduction to Programming with C++ Sixth Edition
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Programming Languages 1.07a.  A computer program is a series of instructions that direct a computer to perform a certain task.  A programming language.
C++ Programming Language Lecture 1 Introduction By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
1.8History of Java Java –Based on C and C++ –Originally developed in early 1991 for intelligent consumer electronic devices Market did not develop, project.
Introduction to Programming Lecture No. 1. Books  Deitel & Deitel :– C++ How to Program  Kernighan and Ritchie:- The C Programming Language.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 1 February 8, 2005.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
Copyright © Prentice Hall Programming and Languages Chapter 14 Telling the Computer What to Do.
Tolo-e-aftab higher education 1 th semester Bcs 1/2/1392 MINISTRY OF HIGHER EDUCATION.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
CHAPTER 1 INTRODUCTION 1 st Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Computing Systems & Programming ECE Fundamental Concepts Chapter 1 Engineering Problem Solving.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
CS-303 Introduction to Programming
Programming Languages
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
Introduction to Computer Programming itc-314 Lecture 04.
CHAPTER 1.1 INTRODUCTION TO COMPUTERS AND C++ Dr. Shady Yehia Elmashad.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Week 6 Dr. Muhammad Ayaz Intro. to Assembly Language.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Software Engineering Algorithms, Compilers, & Lifecycle.
Computer Software 1.
برمجه حاسبات 2 أ. بيان غزلان الفصل الدراسي هـ.
Topic 2: Hardware and Software
CSCI-235 Micro-Computer Applications
Computer Programming Lecturer: Ir Dr Frank H.F. LEUNG
Introduction CSE 1310 – Introduction to Computers and Programming
Presentation transcript:

1 ENG236: Introduction (1) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY

2 References: 1.J. Liberty, Teach Yourself C++ in 24 hours. SAMS, 2005/2009 (electronic book in the library). 2.H. M. Deitel and P. J. Deitel, C++ How To Program, 6th Ed. Prentice Hall, S. Prata, C++ Primer Plus. Fifth Edition, SAMS, Computer Programming and Basic Software Engineering

3 Contents Computer Programming and Basic Software Engineering 1.Introduction (week 1) 2.A Taste of C++ (week 1) 3.The Nuts and Bolts (weeks 2-5) 4.Basic Software Engineering (weeks 6-7) 5.Objects and Classes in C++ (weeks 8-9) 6.Pointers and Arrays (weeks 10-13) 7.Stream I/O 8.Elementary Data Structure 9.Building Graphical User Interface. Second semester First semester

4 Getting Started 1. What is Computer Programming?

5 Computer Programming: A systematic approach to instruct a computer doing something for us. Computer Programming and Basic Software Engineering 1. What is Computer Programming? Hardware CPU Memory I/O devices

6 Process of Computer Programming Computing Problems Algorithms and Data Structures High-level Language Hardware Operating System Application Software Coding Binding (Compile, link and load) Mapping Computer Programming and Basic Software Engineering 1. What is Computer Programming? Details in the following slides Way of thinking Computer

7 Computing Problems Algorithms and Data Structures High-level Language Hardware Operating System Application Software Coding Binding (Compile, link and load) Mapping

8 Identify the Problem Before writing a program, ask yourselves two questions: 1.What is the problem I want to solve? 2.Do I really need to write a program to solve it? A problem can often be so large that requires the co- operation of a few programs to solve it. E.g. To design a computer game - Design the story - Design the graphics - Design the motion : Computer Programming and Basic Software Engineering 1. What is Computer Programming?

9 Do we need to write a program for the following problems? Calculate the result of 1 + 1? Play a piece of MP3 music using the computer? Develop a Web page? No. Just use your fingers! No. Use application software such as Media Player. Yes or no, depending on how complicated your Web page is. Usually we need to write a program if the problem is too complicated and specific to our needs. Computer Programming and Basic Software Engineering 1. What is Computer Programming?

10 Computing Problems Algorithms and Data Structures High-level Language Hardware Operating System Application Software Coding Binding (Compile, link and load) Mapping

11 Find the Best Algorithm A problem can be solved by different approaches Using a clever approach can save you a lot of time in getting the result E.g. Calculate Solution? Use algorithm:12 x (1 + 12) / 2 = 78 1 addition, 1 multiplication, 1 division Computer Programming and Basic Software Engineering 1. What is Computer Programming? 11 additions Seems better, BUT...

12 Consider the following situation: For a particular computer, it may take 10  s to compute an addition but uses 100  s to do a multiplication or division. Calculate Do you still want to use algorithm? Direct addition: 110  sec Use algorithm: 210  sec  Algorithm needs to match with the hardware architecture Computer Programming and Basic Software Engineering 1. What is Computer Programming?

13 Computing Problems Algorithms and Data Structures High-level Language Hardware Operating System Application Software Coding Binding (Compile, link and load) Mapping

14 Coding Computer can only understand 0 and 1. The most direct way to communicate with the computer is to use 0 and 1.  Machine Language Programming : Machine Language Program Very tedious and can make error easily Computer Programming and Basic Software Engineering 1. What is Computer Programming?

15 Coding - Assembly Language Assembly Language is created to help human instruct CPU to work. By using a software tool called Assembler, assembly language programs can be converted into machine language programs. Assembler : LD R0, #05 ADD R0, $1234 : SUB R0, #22 LD $2345, R0 Assembly LanguageMachine Language Computer Programming and Basic Software Engineering 1. What is Computer Programming?

16 Coding - High Level Language Assembly language programming is still too complicated for general users. They are very different from human languages. e.g. “Set W equal to W plus X minus Y divided by Z.” “Repeat the next sequence of instructions until X is less than 0 or Y equals Z.” A high level language is needed to reduce the gap between human and computers. Computer Programming and Basic Software Engineering 1. What is Computer Programming?

17 Give me the result of adding 1 to 10 Compiler Linker : High Level Program Executable Machine Language Program Object code Library Computer Programming and Basic Software Engineering 1. What is Computer Programming?.exe.cpp Details in the following slides

18 Compiler: Generate the object code. Object code  Similar to the machine language code but cannot be executed because of the missing of some information. Linker: Resolve the missing information from the library or other programs. For a program, it is very common that some of the information in the program needs to be obtained from the Library provided by the programming tool. It is the job of linker to obtain these missing information. Computer Programming and Basic Software Engineering 1. What is Computer Programming?

19 Coding - High Level Languages From time to time, high level languages (HLL) are designed for different purposes. Earlier examples: BASIC : for simple and general computing (obsolete for long) COBOL : for data processing (is still using in local banks) FORTRAN : for scientific computation (has been replaced by C or C++) Recent examples: Pascal: a sophisticated but complicated HLL (replaced by C or C++) C : a simple structural HLL for general computing (still in use) Current examples: C++ : the most well-known object-oriented (OO) language Java : an OO language designed with the concept of networking. Computer Programming and Basic Software Engineering 1. What is Computer Programming?

20 Programming - C++ Object-Oriented programming concept is overwhelming. OO Programming has the advantage of achieving reuse of software components. The C++ programming language is created to implement the concept of OO programming. C++ is an extension of the C language. C++ has become the predominant language for the commercial software development. Standardized by the American National Standards Institute (ANSI), C++ program is portable to different machines. Computer Programming and Basic Software Engineering 1. What is a Computer?

21 “Homework” Install Visual Studio 2008 in your PC/notebook. Locate the electronic book “Teach Yourself C++ in 24 hours.”

22 Acknowledgments The slides are based on the set developed by Dr. Frank Leung (EIE).