Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Alexandria University Faculty of Science Computer Science Department Introduction to Programming (CS 102) C++ Programminhg."— Presentation transcript:

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

2 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

3 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)

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

5 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:https://www.alexu.edu.eg

6 Lecture 1 Overview of Computer, Programming and Problem Solving 6

7 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).

8 The Program Development Life Cycle

9 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.

10 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.

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

12 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.

13

14 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

15

16

17

18 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.

19

20 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.

21 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

22

23 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.

24

25 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.

26

27 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.

28 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.

29 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.

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

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

32 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

33 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.

34 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).

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

36

37 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 )

38

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

40


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

Similar presentations


Ads by Google