Alexandria University Faculty of Science Computer Science Department Introduction to Programming (CS 102) C++ Programminhg.

Slides:



Advertisements
Similar presentations
Computers Are Your Future
Advertisements

CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Alexandria University Faculty of Science Computer Science Department
Professor Michael J. Losacco CIS 1150 – Introduction to Computer Information Systems Programming and Languages Chapter 13.
Chapter 13 Programming Languages and Program Development
Programming Creating programs that run on your PC
Programming System development life cycle Life cycle of a program
McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 14 Programming and Languages.
Computer Programming How Can You Create Your Own Software? Chapter 11.
Chapter 16 Programming and Languages: Telling the Computer What to Do.
Your Interactive Guide to the Digital World Discovering Computers 2012 Chapter 13 Computer Programs and Programming Languages.
Program Development and Programming Languages
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
McGraw-Hill Technology Education © 2006 by the McGraw-Hill Companies, Inc. All rights reserved CHAPTER PROGRAMMING AND LANGUAGES.
1414 CHAPTER PROGRAMMING AND LANGUAGES. © 2005 The McGraw-Hill Companies, Inc. All Rights Reserved Competencies Describe the six steps of programming.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
An Overview of Computers and Programming
PRE-PROGRAMMING PHASE
Computer Programming How Can You Create Your Own Software? Chapter 13.
Programming Concepts and Languages Chapter 12 – Computers: Understanding Technology, 3 rd edition 1November
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Building Applications.
Your Interactive Guide to the Digital World Discovering Computers 2012.
CS102 Introduction to Computer Programming
© Paradigm Publishing Inc Chapter 12 Programming Concepts and Languages.
Computers Are Your Future Tenth Edition Chapter 11: Programming Languages & Program Development Copyright © 2009 Pearson Education, Inc. Publishing as.
Chapter 13 Programming Languages and Program Development 1.
Program Development and Programming Languages
Computers Are Your Future Tenth Edition Chapter 11: Programming Languages & Program Development Copyright © 2009 Pearson Education, Inc. Publishing as.
Program development & programming languages Chapter 13.
Programming Languages CPS120: Introduction to Computer Science Lecture 5.
Computers Are Your Future Eleventh Edition
Structured COBOL Programming, Stern & Stern, 9th edition
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
CC111 Lec#5: Program Development 1 Program Development and Programming Languages Lecture 4 Reference :Understanding Computers Chapter 13.
Understanding Computers Ch. 131 Chapter 13 Program Development and Programming Languages.
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
Programming Languages 1.07a.  A computer program is a series of instructions that direct a computer to perform a certain task.  A programming language.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
Chapter 15 Program Development and Programming Languages.
1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER.
Computing Essentials 2014 Programming and Languages © 2014 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not.
Discovering Computers 2009 Chapter 13 Programming Languages and Program Development.
Computer Programs and Programming Languages What are low-level languages and high-level languages? High-level language Low-level language Machine-dependent.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Software Development Programming & Languages. Programming: A Five-Step Procedure Define the problem Design a solution Code the program Test the program.
Programming and Languages
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
Alexandria University Faculty of Science Computer Science Department Introduction to Programming C++
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
 Problem Analysis  Coding  Debugging  Testing.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Your Interactive Guide to the Digital World Discovering Computers 2012 Chapter 13 Computer Programs and Programming Languages.
CSCI-235 Micro-Computer Applications
Chapter 2- Visual Basic Schneider
Programming Concepts and Languages
Program Development and Programming Languages
Developing Applications
Chapter 12 Programming Concepts and Languages.
Chapter 2- Visual Basic Schneider
Chapter 2- Visual Basic Schneider
and Program Development
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Presentation transcript:

Alexandria University Faculty of Science Computer Science Department Introduction to Programming (CS 102) C++ Programminhg

Course Goals  Introduce General concepts of Programming  Begin to Think Like a Programmer  Start Programming With C++ (a powerful, widely-used programming language)  Become Junior C++ Programmer

Course Outline: 3 Introduction to Programming and problem solving. Program structure and simple program. Data types Assignment statements Input / output operations Arithmetic operations Logical operations Conditional and selection control statements Loops Functions (call by value / reference) Arrays ( 1D and 2D)

Course grading system Week #Marks Type 720ExamWritten 1210ExamPractical ExamOral / Assignments 1460ExamFinal 4

Course textbook C How To Program 7/e by:Paul Deitel & Harvey Deitel 5 C OURSE L ECURES / ASSIGNMENTS PDF copy on terminals in lab. Printed copy in copy centers. URL:

Lecture 1 Overview of Computer, Programming and Problem Solving 6

The Program Development Life Cycle Creating new programs is called program development. Creating successful applications requires planning Computer professionals need to develop new or modified applications from time to time The process associated with creating successful applications programs is called the program development life cycle (PDLC).

The Program Development Life Cycle

1. Problem Analysis During analysis, a systems analyst and programmer: – review specifications, and – talk with users to fully understand what the software should do. Documentation consists of: – program specifications, – timetable, – which language will be used, – how the program will be tested, and – what documentation is required.

2. Program Design Program design: stage where program specifications are expanded into a complete design of the new program. Structured programming and object-oriented programming are two of the most significant approaches to the design process.

Program Design: Program Design Tools Program design tools are planning tools. Structure charts Program flowcharts Pseudocode Data modeling

Structure Charts Structure charts depict the: –overall organization of a program, and –how the modules of a program are defined and –how they connect to each other hierarchically. Program modules should be arranged hierarchically  in a top-down fashion Why?? So that their relationship to each other is apparent.

Flowcharts Use geometric symbols and familiar relational operators to provide a graphic display of the sequence of steps involved in a program Different symbols are used to represent different actions such as − Start/stop −Decision −Input/output −Processing −Looping symbols

Pseudocode Uses English-like statements in place of the graphic symbols of the flowchart. Unlike a flowchart, pseudocode is easy to modify and can be embedded into a program as comments. No standard set of rules exists for writing pseudocode, although a number of conventions have been developed.

Program Design: Program Design Tools Data modeling is a technique used to illustrate the data in an application and is frequently used with object-oriented programming. In a data model, the objects in the program are identified, along with their variables and class.

Program Design: Good Program Design Good program design is essential; it can save time and it produces a better end result. Some principles of good program design are: Be specific One-entry-point, one-exit-point rule No infinite loops Documentation during program design includes all the design specifications

3. Program Coding Coding: actual process of creating the program in a programming language. – Programming language must be chosen. – Coding standards should be adhered to. – Make use of reusable code and data dictionaries. – Translate coded programs into executable code. Documentation results in finished source code.

3. Program Coding cont’d The coded program is referred to as source code. To be executed, the program is converted by the computer to object code using a special program. A compiler translates the entire program into machine language before executing it. The program then doesn’t need to be recompiled until it is modified. An interpreter translates program statements one at a time. Interpreters are helpful during the debugging stage, but are slower during execution of the finished program. An assembler converts assembly-language statements into machine language.

4. Program Debugging and Testing Debugging: process of making sure a program is free of errors or bugs. – Preliminary bugging often finds syntax or logic errors. – Testing can consist of alpha or beta testing. Documentation includes a copy of the finished program code, plus test data and results.

4. Program Debugging and Testing cont’d Preliminary debugging begins after the program has been entered into the computer system. Rarely is a program error-free the first time it runs. Two common types of errors are syntax errors and logic errors: −A syntax error occurs when the programmer has not followed the rules of the language. −A logic error, or execution-time error, results when the command syntax is correct but the program is producing incorrect results.

5. Program Maintenance Program maintenance: process of updating software so that it continues to be useful. – A costly process, but can be used to extend the life of a program. Documentation consists of amended program package reflecting what problems occurred and what program changes were made.

What Is a Programming Language? A programming language is a set of rules used to write instructions to the computer.

Categories of Programming Languages Low-level languages High-level languages Fourth-generation languages (4GLs) Natural and visual languages

Machine and Assembly Languages Machine and assembly languages are called low-level languages Programmers who code in them must write instructions at the finest level of detail, the base level of the hardware Virtually no one writes machine-language programs anymore All programs must be translated by a language translator into machine language before they are executed Assembly languages are fast and consume little storage when compared with higher-level languages, but take longer to write and maintain

High-Level Languages  High-level languages differ from their low-level predecessors in that they require less coding detail and make programs easier to write. Programs written in a high-level language (BASIC, COBOL, Pascal, C, etc.) need to be translated into machine language before they can be executed.

Fourth Generation Languages (4GL) Very-high-level languages that are much easier to use than the high-level languages They are declarative rather than procedural languages. For instance, to draw a bar chart in a procedural language, you must tell the computer how to draw bars and where to place them. In a declarative language, you may be able to just point to the data you want graphed, click several menu choices, and you’re in business. Fourth-generation languages are commonly used to access databases (query languages).

Popular Programming Languages FORTRAN COBOL Pascal BASIC and Visual Basic C, C++, AND C# Java

Markup Languages Markup languages use symbols or tags to describe what a document should look like when displayed. – HTML (Hypertext Markup Language) – Dynamic HTML – XML (extensible markup language) – XHTML (extensible Hypertext Markup Language) – WML (Wireless Markup Language )

Scripting Languages Scripting languages are used to build program instructions into Web pages, usually to add dynamic content. – JavaScript – VBScript – Perl