Lecture 1 - Intro To Computing PDF
Lecture 1 - Intro To Computing PDF
ENGR 1200U Introduction to Programming Lecture 1 Course Overview Introduction to Computing Dr. Eyhab Al-Masri
1992-2012 by Pearson Education, Inc. & John Wiley & Sons References: Engineering Problem Solving with C++ (Etter et al.), C++ How to Program (Deitel et al.), C++ for Everyone (Horstmann)
Textbook
Evaluation Method
Assignments 20% Quizzes 10% Midterm Exam (Wed Feb 27) 20% Final Exam (TBD) 50%
1/7/2013
1/7/2013
In 1842, Augusta Ada Byron (below) wrote the first computer program.
Early 1800s, Charles Babbage (above) designed the Analytical Engine (left) to process decimal numbers
ENGR 1200U Winter 2013 - UOIT
Read instructions from punched cards and carried them out Punch different programs on input cards
1/7/2013
Storage unit (memory) Processing unit (computation unit) Input device (punched card reader) Output device (punched and printed output)
Luigi F. Menabrea, French engineer and mathematician, described Babbages vision of a machine capable of solving any problem using:
Inputs Outputs Programs written on punch cards
Published a paper Sketch of the Analytical Engine Invented by Charges Babbage, Esq
1/7/2013
Wrote the English translation of Menabreas Sketch of the Analytical Engine Envisioned the multidisciplinary potential of the Analytical Engine Wrote detailed instructions for performing numerical computations using the Analytical Engine
Developed at Iowa State University between 1939 and 1942 by John Atanasoff and Clifford Berry
1/7/2013
Developed by research team lead by John Mauchly and J. Presper Eckert during the early 1940s
Consisted of 18,000 vacuum tubes and 1500 relays Weight: 30 tons, 6000 switches, many jumper cables Consumed: 140 kilowatts of power
ENIAC executes hundreds of operations per second (30 tons) Todays processors execute trillions of operations per second and weigh ounces.
ENGR 1200U Winter 2013 - UOIT
1/7/2013
Advances of the digital computer has facilitated many significant engineering achievements over the past five decades
Achievements illustrate how engineering has improved our lives and expanded possibilities of the future
Application Satellites
Used to provide weather information, relay communication signals, maps, and environmental updates Example: GPS Allow for experimentation that may not be possible (due to size, speed, dangers to health and safety, etc)
Computer Simulations
1/7/2013
You have probably used a computer for study, work or fun Many people use computers for everyday tasks such as electronic banking or writing a term paper Computers are good for such tasks C++ is a powerful computer programming language thats appropriate for technically oriented people to use in building substantial information systems
In use today are more than a billion generalpurpose computers and billions more cell phones, smartphones and handheld devices (such as tablet computers) The number of mobile Internet users will reach approximately 134 million by 2013
1/7/2013
By 2014, the smartphone applications market is expected to exceed $40 billion, which is creating significant opportunities for programming mobile applications Studies have projected smartphone sales to surpass personal computer sales in 2011 and tablet sales to account for over 20% of all personal computer sales by 2015
1/7/2013
Computers can carry out a wide range of tasks because they execute different programs, each of which directs the computer to work on a specific task The computer itself is a machine that stores data (numbers, words, pictures), interacts with devices (the monitor, the sound system, the printer), and executes programs
A computer program tells a computer, in minute detail, the sequence of steps that are needed to fulfill a task Hardware The physical computer and peripheral devices are collectively called the hardware Software The programs the computer executes are called the software
10
1/7/2013
Programming
11
1/7/2013
In 1946, John von Neumann proposed a computing model that is still used today in the design of most digital computers
heart of the computer executes one operation at a time performs program control and data processing
12
1/7/2013
The CPU
carries out arithmetic operations such as addition, subtraction, multiplication, and division fetches data from external memory or devices and stores data back
All data must travel through the CPU whenever it is moved from one location to another
13
1/7/2013
Controls the transfer and processing of data Retrieves and interprets instructions stored in memory Accepts data from an input device (i.e. keyboard or mouse), Sends data to a specified output device (i.e. printer or display) Stores data in the memory unit
14
1/7/2013
The computer transmits information (called output) to the user through a display screen, speakers, and printers The user can enter information (called input) for the computer by using a keyboard or a pointing device such as a mouse
Computer software contains the instructions or commands that we want the computer to perform There are several categories of software (right)
1. 2. 3.
15
1/7/2013
Operating Systems typically comes with the computer hardware when purchased OS provides an interface between the user and the hardware (allows user to select and execute software) OS contain a group of programs called utilities that allow the user to perform functions such as printing files, copying files, etc OS simplify the interface with the OS by using icons and menus (Examples: Windows)
Common Applications
Purpose: Perform common operations Examples: word processors, text editors, spreadsheet Purpose: Efficiently store and retrieve larges amounts of data Examples: MySQL, Oracle, Microsoft SQL Purpose: Define objects and manipulate them graphically Examples: AutoCAD, Architectural Desktop, Civil 3D which Purpose: Powerful mathematical commands & generate graphs Examples: Matlab, Mathematica, Maple
16
1/7/2013
Computer languages can be described in terms of levels Programmers write instructions in various programming languages, some directly understandable by computers and others requiring intermediate translation steps. These may be divided into three general types: Machine languages Assembly languages High-level languages
Most primitive and are tied closely to the design of the hardware (instructions are encoded) Generally consist of strings of numbers (ultimately reduced to 1s and 0s) Machine dependenta particular machine language can be used on only one type of computer Machine language differs from one machine to another (i.e. Sun versus HP computer)
17
1/7/2013
Assembly language
Instructions are written in symbolic statements instead of binary Also unique to a specific computer design Usually have limited set of statements
High-level language
Have English-like commands and instructions Examples: C, C++, Java, VB.NET, C#, etc Independent of the processor type and hardware Writing programs in high-level language is much easier that machine or assembly Contain large number of commands and an extensive set of syntax (or grammar) rules
18
1/7/2013
Computers only understand machine language High-level languages like C++ must be translated to machine language for execution
Compiler
A special computer program that translates higher-level programs into machine instructions for a particular processor
printable/Readable Program file nonprintable machine readable file nonprintable executable code
Executable Program
19
1/7/2013
Syntax/Parse Errors
Linking Errors
Run-time Errors
20
1/7/2013
Process of eliminating logic errors (i.e. bugs) from programs User-friendly programming environments such as Microsoft Visual C++ integrate the compiler with
text processors and code editors special tools to help find bugs in programs (debugger) testing tools and much more
You will need to know how to log in (if needed), and, how to start your C++ development environment An IDE (integrated development environment) is where you will most likely work
21
1/7/2013
You will become a typist because you will use an editor to type your C++ programs into the IDE Your program is called a source program (file)
You will need to learn how to compile and run your program in the IDE
Theres a lot going on behind the scenes in the IDE that you dont normally see
22
1/7/2013
The linker combines machine code with library code into an executable program
23
1/7/2013
You will need to know your computers file system: files, folders, and extensions C++ program files typically have the extension: .cpp (or .cc or .cxx or even .C) You should be organized by creating folders for organizing your files
24