1 / 12

Overview of Computers and Programming Languages

Overview of Computers and Programming Languages. What is a computer What is a programming language C++ Structured vs. object-oriented programming A simple program. What Is A Computer. A computer is a device capable of performing computations and making logical decisions at very high speed

midori
Download Presentation

Overview of Computers and Programming Languages

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. Overview of Computers and Programming Languages • What is a computer • What is a programming language • C++ • Structured vs. object-oriented programming • A simple program Chapter 1 Overview of Computers and Programming Languages

  2. What Is A Computer • A computer is a device capable of performing computations and making logical decisions at very high speed • A computer can do nothing without software. Chapter 1 Overview of Computers and Programming Languages

  3. What Is A Computer • Input unit • Output unit • Memory Unit • Arithmetic logic unit (ALU) • Central processing unit (CPU) • Secondary storage unit Secondary Storage Unit Output Unit CPUALUMemory Unit Input Unit Chapter 1 Overview of Computers and Programming Languages

  4. What Is A Programming Language • A vocabulary and set of grammatical rules for instructing a computer to perform specific tasks. • The term programming language usually refers to high-level languages, such as BASIC, C, C++, COBOL, FORTRAN, Java, and Pascal. From http://webopedia.internet.com/ Chapter 1 Overview of Computers and Programming Languages

  5. Programming Language Hierarchy • Machine Language100100 010001100110 010010100010 010011 • Assembly LanguageLOAD rateMULT hoursSTOR wages • High-level Languagewages = rate * hours http://www.webopedia.com Chapter 1 Overview of Computers and Programming Languages

  6. C++ Development Environment C++ Language C++ Standard Library C++ System Underlying Software VocabularyGrammatical Rules Precompiled Routine Program Chapter 1 Overview of Computers and Programming Languages

  7. C++ Development Environment .cpp .obj .exe Chapter 1 Overview of Computers and Programming Languages

  8. Structured Programming • AlgorithmA set of steps to solve a problem. • Structured design approach • Top-down design • Stepwise refinement • Modular programming Chapter 1 Overview of Computers and Programming Languages

  9. Example of Algorithm • Find the perimeter and area of a rectangle • Get the length of the rectangle • Get the width of the rectangle • Find the perimeter using the followingperimeter = 2 * (length + width) • Find the area using the followingarea = length * width • Output the result Chapter 1 Overview of Computers and Programming Languages

  10. Object-Oriented Programming • First step: identify components of the problem space ---- objectsrectangle • Second step: specify for objects their attributes (data) and possible operations (methods) to be performed on these attributes • OOP still needs structured programming techniques Chapter 1 Overview of Computers and Programming Languages

  11. New project -> Visual C++ -> “Win32 Console Applications” • “Console application” + “Empty project” • Project -> Add new item ->Visual C++ -> Code -> C++ file (.cpp) Chapter 1 Overview of Computers and Programming Languages

  12. Chapter 1 Overview of Computers and Programming Languages

More Related