lec by fadysamora

VIEWS: 3 PAGES: 25

									Fundamentals of
   Structured
 Programming
    Dr. Salma Hamdy
    s.hamdy@cis.asu.edu.eg
Course – Information

 • Code: CSW150
 • (3 hour lecture + 2 hour lab) a week.
 • Assessment (125)
      Final Term Examination   90
      Oral Discussion          10
      Practical Examination    15
      Mid Term + Assignments   10

 • Office hours: Wednesday 9:00am-11:30am.
Course – Text Book and References
 • Absolute C++, 4th edition, Walter Savitch,
   Addison Wesley, 2009.



 • C++ How to Program, 8rd edition, Deitel &
   Deitel, Prentice Hall, 2012.




 • References: ENDLESS list.
Course – Outline
 1. Introduction
 2. Basics
 3. Flow of Control
 4. Functions
 5. Parameters, Overloading, and Reference
 6. Arrays and Structures
 7. Pointers and Dynamic Arrays
 8. Strings
 9. Recursion
 10. Templates
 11. Exception Handling
 12. Streams and File I/O
Course – Outcomes
During and upon the completion of this course, you will:
• Have a basic understanding of structured programming
  concepts and how computers understand your code.
• Know how to design, analyze, and code simple and
  sophisticated programs using C++ language that execute
  efficiently.
• Make use of simple data structures, linear algebra, and
  other knowledge to solve real problems.
• Require substantial programming effort and good
  software engineering practice.
• Develop and deploy a C++ application of your own design.
Introduction
Contents
1. Introduction to Computers
2. Introduction to C++ Programming
     • Variables, expressions, assignment
     • Console input/output
     • Namespaces
3.    Flowcharts
4.    Summary
5.    Next Lecture
6.    Assignment
1. Introduction to Computers
• Computers = devices (HW) that can perform
  computations and make logical decisions
  phenomenally faster than human beings can.

• They process data under the control of sets
  of instructions called computer programs
  (SW).
1. Introduction to Computers – (cont.)
• Computer Organization
                       Memory
                        unit


        Input                   Output
                        ALU
         unit                    unit



                        CPU

           Secondary
            Storage
1. Introduction to Computers – (cont.)
• Data Hierarchy
1. Introduction to Computers – (cont.)
• Talking to your Computer
1- Machine Language




                             - Directly understandable by computer.
                             - String of numbers (1s and 0s)
                             - Machine dependant.
                             - Too tedious for programmer.
                             - Too many instructions.
1. Introduction to Computers – (cont.)
• Talking to your Computer
1- Machine Language

1- Assembly Language


                             - English-like abbreviations.
                             - Requires assembler.
                             - Still too many instructions.
1. Introduction to Computers – (cont.)
• Talking to your Computer
1- Machine Language

1- Assembly Language

3- High Level Language
1. Introduction to Computers – (cont.)
• Talking to your Computer
1- Machine Language

1- Assembly Language

3- High Level Language
 C++, C, Microsoft’s .NET languages (e.g.,
 Visual Basic, Visual C++ and Visual C#) and
 Java
1. Introduction to Computers – (cont.)
• Introduction to Object Technology
• Objects, or more precisely, the classes
  objects come from, are essentially reusable
  software components.
• Example: Automobile class.
• Object Oriented Programming (OOP)
  – Reuse
  – Encapsulation
  – Inheritance
1. Introduction to Computers – (cont.)
• C++ Development Environment
• C++ programs consist of pieces called classes
  and functions.
• Even if you don’t follow the OOP approach,
  you will still take advantage of the rich
  collections of classes and functions in the
  C++ Standard Library.
1. Introduction to Computers – (cont.)
• C++ Development Environment
1- Creating Program
 - Source code
 - Popular IDEs: Microsoft® Visual Studio 2010
 Express Edition, Dev C++, NetBeans, Eclipse.


2- Preprocessing
  - Automatically
  - Preprocessor directives
1. Introduction to Computers – (cont.)
• C++ Development Environment
3- Compiling
 - Object code


4- Linking
 - Object code to needed parts
1. Introduction to Computers – (cont.)
• C++ Development Environment
5- Loading
  - With other needed libraries.




6- Executing
  - One instruction at a time.
2. Introduction to C++ Programming
•   Variables
•   Namespaces
•   Expressions
•   Console input/output
•   Assignment
•   Program style
2. Introduction to C++ Programming
Example 1
• Printing a line of text

Example 2
• Adding two integers

Example 3
• Comparing two integers
3. Flowcharts
4. Summary
•   Computers and programs lifecycle
•   Programming language levels
•   C++ program style
•   Basic input/output
•   Simple arithmetic
•   Flowchart
5. Next Lecture
• More Basics
• Flow of Control
6. Assignment
C++ How to Program
• Chapter 1
  1.4, 1.5, and 1.6
• Chapter 2
  2.7, 2.8, 2.9, 2.10, 2.11, 2.12, 2.13, and 2.14

								
To top