1 / 37

Programming with Visual C++: Concepts and Projects

Programming with Visual C++: Concepts and Projects. Chapter 1A: Introduction (Concepts). Objectives. In this chapter, you will: Learn about the fundamental concepts of object-oriented programming Explore the fundamental hardware components of a computer

carolssmith
Download Presentation

Programming with Visual C++: Concepts and Projects

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programming with Visual C++: Concepts and Projects Chapter 1A: Introduction (Concepts)

  2. Objectives In this chapter, you will: Learn about the fundamental concepts of object-oriented programming Explore the fundamental hardware components of a computer Learn about the fundamental types of software Programming with Visual C++: Concepts and Projects

  3. Objectives (continued) Study important people and events in the history of computer hardware and software development Learn about the program compilation process and the project design methodology Explore the Visual Studio IDE Create your first Microsoft Visual C++ program Programming with Visual C++: Concepts and Projects

  4. Objectives (continued) Create and use TextBox and Button controls Write and run C++ code that responds to a button click Read and interpret error messages Programming with Visual C++: Concepts and Projects

  5. Object Oriented Programming • Visual C++ is: • A programming language used to write software • Developed by Microsoft for Windows computers • Derived from the standard version of C++ • An object-oriented programming language Programming with Visual C++: Concepts and Projects

  6. Object Oriented Programming (continued) • Object oriented programming languages create objects that can be manipulated, for example: • Visual objects (like buttons you can click on) • Data objects (like a list of exam scores) • Objects • Have attributes and operations (called methods) associated with them • Are based on definitions (called class definitions) Programming with Visual C++: Concepts and Projects

  7. Object Oriented Programming (continued) Programming with Visual C++: Concepts and Projects

  8. Object Oriented Programming (continued) Programming with Visual C++: Concepts and Projects

  9. Object Oriented Programming (continued) • Visual C++ is used to create programs that present a Graphical User Interface (GUI) • A GUI is an object (called a form) • Typical attributes include • Button objects to click on • Textbox objects to enter or display data • Typical methods include • Programs that carry out tasks when a button is clicked Programming with Visual C++: Concepts and Projects

  10. Object Oriented Programming (continued) Programming with Visual C++: Concepts and Projects

  11. Hardware Fundamentals • Fundamental hardware components • Input • Means of getting data into the computer • Examples: mouse, keyboard • Output • Means of displaying results • Examples: display, printer Programming with Visual C++: Concepts and Projects

  12. Hardware Fundamentals (continued) • Fundamental hardware components • Processing (Central Processing Unit – CPU) • Arithmetic/Logic Unit – Handles numerical tasks and comparisons • Controller – Handles task scheduling • Memory • Microchips used to store data temporarily while program is running • Storage • Stores data permanently, even when computer is turned off • Examples: CDs, DVD, flash drives, hard drives Programming with Visual C++: Concepts and Projects

  13. Hardware Fundamentals (continued) Programming with Visual C++: Concepts and Projects

  14. History of Hardware Development • Modern computing required: • Invention of electronic binary methods of computing • Development of machines that were able to store their own programs • Advent of large-scale electronic circuitry Programming with Visual C++: Concepts and Projects

  15. History of Hardware Development (continued) • Four generations of hardware development • First generation (1930’s-1950’s) • Vacuum tube technology • Computers were large and subject to frequent component failure • Example: ENIAC (WWII project at U of Pennsylvania) • Second generation (late 1950’s – 1960’s) • Transistorized technology • Complex wiring Programming with Visual C++: Concepts and Projects

  16. History of Hardware Development (continued) Programming with Visual C++: Concepts and Projects

  17. History of Hardware Development (continued) • Four generations of hardware development (continued) • Third generation (late 1960’s – 1970’s) • Integrated circuit (IC) technology • Mass-produced, small-scale integration of components • Fourth generation (late 1970’s – today) • Microprocessors • Very large scale integration of components on a single microchip • Made microcomputers possible Programming with Visual C++: Concepts and Projects

  18. Software Fundamentals • Types of software • System software • Includes: • Operating systems (UNIX, Mac OSX or Microsoft Windows for example) • Utility programs • Used to manage files • Read from input devices • Control output to the screen • Interfaces directly with hardware components Programming with Visual C++: Concepts and Projects

  19. Software Fundamentals (continued) • Types of software (continued) • Applications software • Purpose is tied to needs of user • Uses resources provided by operating system • General-purpose • May be used by different users for different purposes • Word processors, spreadsheets, databases, e-mail programs, and Web browsers for example • Dedicated purpose • Used to carry out specific tasks only Programming with Visual C++: Concepts and Projects

  20. Software Fundamentals (continued) Programming with Visual C++: Concepts and Projects

  21. Software Fundamentals (continued) Programming with Visual C++: Concepts and Projects

  22. Software Fundamentals (continued) Programming with Visual C++: Concepts and Projects

  23. Software Fundamentals (continued) Programming with Visual C++: Concepts and Projects

  24. Software Fundamentals (continued) Programming with Visual C++: Concepts and Projects

  25. Software Fundamentals (continued) Programming with Visual C++: Concepts and Projects

  26. History of Software Development • Machines language • Consists of binary codes (0’s and 1’s) • Assembly language • Uses short commands to stand for specific machine language tasks • High-level language • English-like • Portable from one computer to another • C++ and Visual C++ are high-level languages Programming with Visual C++: Concepts and Projects

  27. History of Software Development (continued) • Procedural languages • 1950’s • FORTRAN, COBOL, LISP • 1960’s • BASIC • 1970’s • C, Pascal • Object oriented • Simula (1967), SmallTalk (1980), C++ (1983), Java (1995) Programming with Visual C++: Concepts and Projects

  28. The Programming Process • Source code is program written in high-level programming language (like Visual C++) • Object code is low level code (binary level, machine language) • Computers require low-level instructions • Compilers turn source code into object code • If errors are found compilation ceases • The program must be debugged and recompiled Programming with Visual C++: Concepts and Projects

  29. The Programming Process (continued) Programming with Visual C++: Concepts and Projects

  30. The Programming Process (continued) Programming with Visual C++: Concepts and Projects

  31. Types of Errors • Syntax • Detected by the compiler • Warnings and fatal errors • Usually typographical and easy to fix • Logic • Program compiles and runs but results are incorrect • Often requires redesign of program logic • Runtime • Program stops running unexpectedly • Usually the result of an illegal operation • Example: Division by 0 Programming with Visual C++: Concepts and Projects

  32. A Project Development Strategy • Problem Analysis • Identification of program requirements • Design • Interface sketch and development of solution strategy • Development • Coding in high-level language • Testing • Testing the solution under different scenarios Programming with Visual C++: Concepts and Projects

  33. A Project Development Strategy (continued) Programming with Visual C++: Concepts and Projects

  34. The Visual Studio IDE • Visual C++ is supported by the Visual Studio IDE • An Integrated Development Environment (IDE) contains: • Solution Explorer window • Shows the file structure of your solution • Form layout window and Design tab (Design window) • Allows you to create your interface • Toolbox • Contains control objects you can put on the interface • Properties window • Shows attributes of each object you have selected • Toolbars and menus Programming with Visual C++: Concepts and Projects

  35. Summary • Object Oriented Programming • Class definition • Objects based on class definition • Objects have attributes and methods • Hardware • Five fundamental components of a computer • Four generations of hardware development • Software • System software and applications software Programming with Visual C++: Concepts and Projects

  36. Summary (continued) • The Visual Studio IDE • Integrated programming environment • Programming • Source code is written in a high-level language • The compiler translates source code into object code so that it can execute • Types of errors: Syntax, logic and runtime • The program development process • Four stages: Problem analysis, design, development, testing Programming with Visual C++: Concepts and Projects

  37. Summary (continued) • Visual C++ • Toolbox contains controls for your program • Properties window allows you to change control properties • Event-handlers are methods that belong to particular objects • Visual C++ code is written for each event handler • Assignment statements assign the value on right of = operator to location on left Programming with Visual C++: Concepts and Projects

More Related