140 likes | 150 Views
Learn about the basics of computer programming, including the different programming paradigms and high-level languages. Explore the development cycle and discover popular programming tools.
E N D
Chapter 0 Overview
Why you are here? • Where will you go? • What is this course for?
What Are Computers? • Computers are powerful tools for (generalized) computation • Numerical analysis, database, document processing, control, gaming, … • Computers are fast, precise, and highly flexible. • Complementary roles between man and machine • Human being: Thinking, innovating, … • Machine: Data processing, computation, …
Computer Programming • What is programming? • Computers are quick, reliable, and flexible. • The flexibility of computers is a result of the idea "stored-program control". • We instruct computer to perform tasks via programming - the writing of computer control programs. • Windows programming is the writing of computer programs running within Windows environments.
Computer Programming (cont) • Programming paradigms • Hardwired control, in contrast to flexible stored-program control • Machine code • Assembly language • High-level language • Macro of packages, extensions to designed functionality to fit customer's need • Script of operating systems, such as batch files, shell script, ... • Script of virtual machines, such as Netscape Navigator and Microsoft Internet Explorer are virtual machine for JavaScript.
High-level Language Machine independent (portable) High productivity Assembly Language one instruction to one machine code Assembler Compiler Symbolic version of machine code Machine dependent Direct, low-level hardware control one statement to many machine codes Machine Code Machine Dependent Executable
Computer Programming (cont) • Language translators • Assembler • Compiler • Interpreter • Virtual machines
Computer Programming (cont) • High-level programming languages • Procedural • FOrmula TRANslator (FORTRAN) • Beginner's All-purpose Symbolic Instruction Code (BASIC) • COmmon Business Oriented Language (COBOL) • Pascal • C • Functional • PROgramming in LOGic (PROLOG) • Object-oriented • Object Pascal • C++ • …
Development Cycle Library Editor Compiler Linker XXX.c Source Program XXX.obj Object Program XXX.exe Executable C:\XXX↓ Debugger
Borland Turbo C++ 1.01 • Download from http://bit.kuas.edu.tw/~csshieh/teach/97A/cp/tcpp101.exe • Uncompress to a temporary directory • Run INSTALL.EXE and specify destination directory • Start the Integrated Development Environment (IDE) ~\TC\BIN\TC.EXE
Options | Full menus • Options | Directories... | Output Directory • File | New • File | Save • File | Open • File | Save as... • Compile | Compile to OBJ • Compile | Link EXE file • Compile | Build all
File | DOS shell ... exit • Run | Run ... Window | User screen • Help | Index • Run | Step over • Debug | Toggle breakpoint • Debug | Inspect...
Borland Turbo C++ 1.01 • Microsoft Visual C++ 2005 Express Edition • Dev C++ 4.X • Intel …