Upload
erika-holmes
View
219
Download
4
Embed Size (px)
Citation preview
CS 127Introduction to Computer Science
What is a computer?
“A machine that stores and manipulates information under the control of a changeable program” [1]
“A computer is a general purpose device that can be programmed to carry out a set of arithmetic or logical operations” [2]
Two key concepts:It is a machineIt can be controlled via instructions[1] Python Programming : An Introduction to Computer Science - Zelle[2] Wikipedia
What is a computer program?
“Detailed step by step instructions telling a computer exactly what to do” [1]
“It is a sequence of instructions, written to perform a specified task with a computer” [2]
Computers simply execute programs or instructions
Without being told what to do, computers would not be useful
Software (programs) rules or controls the hardware (physical machine)[1] Python Programming : An Introduction to Computer Science - Zelle[2] Wikipedia
Programming
The process of creating softwareIt is a challenging
You have to see the big pictureYou have to pay attention to every detail
It is important to learn programming because it is such an integral part of computer science
Allows development of problem solving skillsAllows complex systems to be analyzed and
reduced to interactions and understandable subsystems
4
What is computer science?
“The scientific and practical approach to computation and its applications” [1]
Computers are simply a tool that are used in computer science
Three important conceptsDesignAnalysisExperimentation
5[1] Wikipedia
Design
Formulating a solution to a problemOften involves a step by step process for
achieving a resultAn algorithm
Look at problems in a logical way and design a solution
This is a critical process in computer science
Most time should be spent here to allow for efficiency in the development process 6
Analysis
The process of examining algorithms and problems mathematically
Every algorithm to solve a problem cannot always be implementedLack of computational resourcesNot feasible time-wiseNot enough memory
Analysis of algorithms is important in computer science
The bottom line is whether a working, reliable system can be built 7
Other areas of computer scienceNetworkingHuman-Computer InteractionArtificial IntelligenceComputational Science (using
computers to model scientific data)DatabasesSoftware EngineeringWeb and Multimedia DesignMIS (Management Information Systems)Security 8
Computer Hardware
9
Computer Hardware
Central Processing Unit (CPU) - Brain of the computer
Memory - Stores programs and dataMain Memory (RAM - Random
Access Memory)RAM - Fast and VolatileCache
Secondary Memory or StorageHard Disk DriveOptical Drive - CD, DVD 10
Computer Hardware
Peripheral DevicesKeyboard - InputMouse - InputMonitor - OutputPrinter - Output
11
Computer Hardware
12
Programming Languages
Computers need to be told in explicit terms what actions they must perform
Languages that computers can understand need to be precise and exact
Every structure in a programming language has a precise form (syntax) and a precise meaning (semantics)
Programs are often referred to as computer code and the process of writing an algorithm in a programming language is called coding 13
Programming
Programming languages are considered “higher level” languages
Computer hardware can only understand “low-level” languages referred to as “machine language”
Computers understand binary (1s and 0s)
A higher level language is converted into a lower level language by:CompilationInterpretation 14
Compiler vs Interpreter
15
Compiler Interpreter
Takes high level source code and converts it into low level machine code
Analyzes and executes source code instruction by instruction
Once program is compiled, it can be run multiple times without needing the compiler and source code
Interpreter and source needed every time the program is run
Compiled programs are generally faster
Interpreted programs are more flexible as you can develop and run programs interactively
Portability
Machine language is specific to a particular CPU
Each kind of computer has its own machine language
Programs written in a high level language can be run on different computers as long as a compiler and interpreter exists for that computer
16
Python
It is an interpreted languageSimple yet powerful and robustGood initial language to learn
programmingCompanies that use Python
GoogleYahooDisneyIBMNASA 17
Running Python programs
IDLE GUICommand line InterpreterGood resource
http://www.python.org/doc/
18