Anda di halaman 1dari 32

Chapter 1

Introduction to Computers, the Internet


and the Web

OBJECTIVES

Basic computer concepts


Different types of programming languages
C programming language

History

C Standard Library

Object-oriented Programming

Typical C Program Development Environment

The history of the Internet and the World Wide Web


Review

What is a Computer?

Computer
Device capable of performing computations and making logical
decisions (hardware)
Computers process data under the control of sets of instructions called
computer programs (software)
Hardware
Various devices comprising a computer, such as central processing unit
(CPU), memory, motherboard and hard disks as well as peripheral
devices (keyboard, screen, mouse CD-ROM)
Hardware trends Every year or two the following approximately
double:

Amount of memory in which to execute programs


The processor speed at which computers execute their programs

Software
Programs that run on a computer

Computer Organization

Six logical units in every computer:


Input unit
Obtains information from input devices (keyboard, mouse)

Output unit

Memory unit

Performs arithmetic calculations and logic decisions

Central processing unit (CPU)

Rapid access, low capacity, stores input information

Arithmetic and logic unit (ALU)

Outputs information (to screen, to printer, to control other devices)

Supervises and coordinates the other sections of the computer


ALU is now a fundamental building block of the CPU

Secondary storage unit

Cheap, long-term, high-capacity storage


Stores inactive programs

Hardware

Evolution of Operating Systems

Batch processing
Do only one job or task at a time
Operating systems
Manage transitions between jobs
Increased throughput

Amount of work computers process

Multiprogramming
Computer resources are shared by many jobs or tasks
Timesharing
Computer runs a small portion of one users job then moves
on to service the next user

Operating Systems

Macintosh

Personal Computing, Distributed Computing, and


Client/Server Computing

Personal computers
Economical enough for individual
Distributed computing
Computing distributed over networks
Client/server computing
Sharing of information across computer networks between
file servers and clients (personal computers)

Personal Computing, Distributed Computing, and


Client/Server Computing

OBJECTIVES

Basic computer concepts


Different types of programming languages
C programming language

History

C Standard Library

Object-oriented Programming

Typical C Program Development Environment

The history of the Internet and the World Wide Web


Review

Machine Languages, Assembly Languages, and Highlevel Languages


Three types of programming languages
1.
Machine languages

2.

Assembly languages

3.

Strings of numbers giving machine specific instructions


Example: +1300042774
English-like abbreviations representing elementary computer
operations (translated via assemblers)
Example: LOAD
BASEPAY

High-level languages

Codes similar to everyday English


Use mathematical notations (translated via compilers)
Example: grossPay = basePay + overTimePay

Fortran, COBOL, Pascal and Ada

FORTRAN
Developed by IBM Corporation in the 1950s
Used for scientific and engineering applications that require
complex mathematical computations
COBOL
Developed in 1959 by computer manufacturers, the government and
industrial computer users
Used for commercial applications that require precise and efficient
manipulation of large amounts of data Pascal
Pascal
Developed by Professor Niklaus Wirth in 1971
Designed for teaching structured programming
Ada
Developed under the sponsorship of the U.S. Department of Defense
(DOD) during the 1970s and early 1980s

Able to perform multitasking

OBJECTIVES

Basic computer concepts


Different types of programming languages
C programming language

History

C Standard Library

Object-oriented Programming

Typical C Program Development Environment

The history of the Internet and the World Wide Web


Review

History of C

C
Evolved by Ritchie from two previous programming
languages, BCPL and B
Used to develop UNIX
Used to write modern operating systems
Hardware independent (portable)
By late 1970's C had evolved to Traditional C
Standardization
Many slight variations of C existed, and were incompatible
Committee formed to create a "unambiguous, machineindependent" definition
Standard created in 1989, updated in 1999

C Standard Library

C programs consist of pieces/modules called functions


A programmer can create his own functions

Programmers will often use the C library functions

Advantage: the programmer knows exactly how it works


Disadvantage: time consuming
Use these as building blocks

Avoid re-inventing the wheel

If a premade function exists, generally best to use it rather


than write your own
Library functions carefully written, efficient, and portable

OBJECTIVES

Basic computer concepts


Different types of programming languages
C programming language

History

C Standard Library

Object-oriented Programming

Typical C Program Development Environment

The history of the Internet and the World Wide Web


Review

The Key Software Trend: Object Technology

Objects
Reusable software components that model items in the real
world
Meaningful software units

Date objects, time objects, paycheck objects, invoice objects,


audio objects, video objects, file objects, record objects, etc.
Any noun can be represented as an object

Very reusable
More understandable, better organized, and easier to
maintain than procedural programming
Favor modularity

C++

C++
Superset of C developed by Bjarne Stroustrup at Bell Labs
"Spruces up" C, and provides object-oriented capabilities
Object-oriented design very powerful

Dominant language in industry and academia


Learning C++
Because C++ includes C, some feel it is best to master C,
then learn C++
More details of C++, see Chapter 18-27 of the textbook

10 to 100 fold increase in productivity

Java

Java is used to
Create Web pages with dynamic and interactive content
Develop large-scale enterprise applications
Enhance the functionality of Web servers
Provide applications for consumer devices (such as cell
phones, pagers and personal digital assistants)
Java How to Program
Closely followed the development of Java by Sun
Teaches first-year programming students the essentials of
graphics, images, animation, audio, video, database,
networking, multithreading and collaborative computing

BASIC, Visual Basic, Visual C++, Visual C# and .NET

BASIC
Developed in the mid-1960s by Professors John Kemeny
and Thomas Kurtz of Dartmouth College as a language for
writing simple programs

Visual Basic

Introduced by Microsoft in 1991 to simplify the process of


making Windows applications

Visual Basic, Visual C++, and Visual C#

Designed for Microsofts .NET programming platform

OBJECTIVES

Basic computer concepts


Different types of programming languages
C programming language

History

C Standard Library

Object-oriented Programming

Typical C Program Development Environment

The history of the Internet and the World Wide Web


Review

A Typical C Program Development Environment

Phases of C Programs:
Edit (C program file names
should end with the .c
extension)
Preprocess
Compile
Link
Load
Execute

A Typical C Program Development Environment

Phase 1: Create your program with an editor program


Phase 2: A preprocessor find some preprocessor directives
(#include <stdio.h>) to include other files and perform various
text replacements
Phase 3: Compiler compiles the program into machine
languages (object code != object-oriented programming).
Phase 4: A linker links the object code with the code in library
or other places to produce an executable image.
Phase 5: A loader loads the executable image into memory
(RAM).
Phase 6: CPU executes the program one instruction at a time.
The load process in Windows OS is just input the name of the
executable file (for example, lab01.exe).

OBJECTIVES

Basic computer concepts


Different types of programming languages
C programming language

History

C Standard Library

Object-oriented Programming

Typical C Program Development Environment

The history of the Internet and the World Wide Web


Review

History of the Internet

The Internet enables


Quick and easy communication via e-mail
International networking of computers
Packet switching
The transfer of digital data via small packets
Allows multiple users to send and receive data
simultaneously
No centralized control
If one part of the Internet fails, other parts can still operate
TCP/IP
Bandwidth
Information carrying capacity of communications lines

History of the World Wide Web (WWW)

World Wide Web


Locate and view multimedia-based documents on almost
any subject
Makes information instantly and conveniently accessible
worldwide
Possible for individuals and small businesses to get
worldwide exposure
Changing the way business is done

VIP in Computing

Alan Turing: a British mathematician who is the


father of theoretical computer science and artificial
intelligence.
The Turing Award is given annually by
the Association for Computing Machinery (ACM)
to "an individual selected for contributions of a
technical nature made to the computing
community. The contributions should be of lasting
and major technical importance to the computer
field". Often recognized as the Nobel Prize of
computing. As of 2007, the award is
accompanied by a prize of $250,000, cosponsored by Intel and Google.

VIP in Communication

Claude E. Shannon is famous for having


founded information theory with one
landmark paper published in 1948 A
Mathematical Theory of Communication.

OBJECTIVES

Basic computer concepts


Different types of programming languages
C programming language
History
C Standard Library
Object-oriented Programming
Typical C Program Development Environment

The history of the Internet and the World Wide Web


Review

Computer Organization

Hardware: Input/Output; RAM (Random-access memory);


Hard disk (secondary storage unit); ALU/CPU; Motherboard;
Computer Case (power); CD or DVD-ROM (peripheral
components).
Moore Law: the same price for the double of computing
power approximately every one or two years
Software: Operating systems (OS); Application Software. (A
hierarchical structure)
OS manages and coordinates activities and the sharing of the
limited resources of the computer. Applications use
application programming interface (API) provided by
libraries and OS to handle computer resources.

Languages

Machine languages (a numerical representation


+1300042774) are hardware or platform dependent. They
are understood directly by ALU/CPU and thus efficient to
computers. Every CPU model has its own machine code,
or instruction sets.
Assembly languages (a symbolic representation LOAD
BASEPAY) are also architecture dependent. It is difficult to
portable to other systems or machines. Today, it is used
primarily for direct hardware manipulation. Typical uses
are device drivers, low-level embedded systems, and realtime systems.
High-level languages like C are more potable to other
platforms and easy to understand by programmers in an
everyday English format (grossPay = basePay +
overTimePay).

The End
Thank

you very much!