Introduction to Computer Science
By: Huong Nguyen
Online: < http://cnx.org/content/col10776/1.1> This selection and arrangement of content as a collection is copyrighted by Huong Nguyen.
It is licensed under the Creative Commons Attribution License: http://creativecommons.org/licenses/by/3.0/
Collection structure revised: 2009/07/29
For copyright and attribution information for the modules contained in this collection, see the " Attributions" section at the end of the collection.
Introduction to Computer Science
Table of Contents
Chapter 1. Introduction to Computer Science
Information & Information Processing
Data – Information – Knowledge
The First Generation - 1940-1956
The Second Generation - 1956-1963
The Third Generation - 1964-1971: Integrated Circuits
The Fourth Generation - 1971-Present: Microprocessors
The Fifth Generation - Present and Beyond: Artificial Intelligence
Computer Science and Relevant Sciences
Information and Communication Technology
1.2. Data Representation in a Computer
Number Representation in Various Numeral Systems
Converting from decimal to base–b
Data Representation in a Computer. Units of Information
Arithmetic Operations on Integers
Addition and Subtraction of integers
Multiplication and Division of Integers
Logical operations on Binary Numbers
Representation of Real Numbers
The Central Processing Unit (CPU)
Programs and Programming Languages
Classification of Computer Software
The Most Common Commands of an Operating Systems
Brief History of Microsoft Windows
How to start and exit from Windows XP
Changing the Regional and Language Options
Changing the name of a File or Folder
Classification of Computer Networks
Classification by functional relationship
Major Components of a Computer Network
How to Connect to the Internet?
Chapter 2. The C programming languages
History of the C Programming Language
The Integrated Development Environment of C++ 3.0
Basic Components of C Programs
2.2. Data Types and Expressions
Declaration and Usage of Variables and Constants
Other Input and Output Functions
Logical and Relational Operators
Increment and Decrement Operators
Loops : While and Do While, For
Declarations and Usage of Arrays
Read the elements of a 1-dimensional array:
Find the maximum value stored in the array.
Declaration and Usage of Function
Functions and Storage Class Specifiers
Pointers as Function Parameters
Declarations and Uses of Strings
Built-in Functions for Character and String Processing
Character Processing Functions
Character Classification Functions
Declarations and Usage of Structures
Creating Structures as New Data Types
Creating variable of a struct type
Referencing Structure Members with the Dot Operator
Initializing Structure Variables
Comparing Values of Structures
Passing Structures to and from Functions
Passing Structures by Reference
Basics and Classification of Files
Chapter 1. Introduction to Computer Science
1.1. Basic concepts*
Information & Information Processing
Data – Information – Knowledge
The content of the human mind can be classified into four categories:
Data: symbols;
Information: data that are processed to be useful; provides answers to "who", "what", "where", and "when" questions;
Knowledge: understanding of data and information; answers "how" questions;
Wisdom: evaluated understanding.
Data
Data consist of raw facts and figures - it does not have any meaning until it is processed and
turned into something useful.
Data comes in many forms; the main ones are letters, numbers and symbols.
Data is a prerequisite to information. For example, the two data items below could represent some
very important information:
DATA INFORMATION
123424331911 Your winning Lottery ticket number
211192 Your Birthday
An organization sometimes has to decide on the nature and volume of data that is required for
creating the necessary information.
Information
Information is the data that has been processed in such a way as to be meaningful to the person
who receives it.
INFORMATION = DATA + CONTEXT + MEANING
Example
Consider the number19051890. It has no meaning or context. It is an instance of data.
If a context is given : it is a date (Vietnamese use French format ddmmyyyy). This allows us to
register it as 19th May 1890. It still has no meaning and is therefore not information
Meaning : The birth date of Vietnamese President Ho Chi Minh.
This gives us all the elements required for it to be called 'information'
Knowledge
By knowledge we mean the human understanding of a subject matter that has been acquired
through proper study and experience.
Knowledge is usually based on learning, thinking, and proper understanding of the problem area.
It can be considered as the integration of human perceptive processes that helps them to draw
meaningful conclusions.
Consider this scenario: A person puts his finger into very hot water.
Data gathered: The finger nerve sends pain data to the brain.
Processing: The brain considers the data and comes up with...
Information: The painful finger means it is not in a good place.
Action: The brain tells finger to remove itself from hot water.
Knowledge: Sticking the finger in hot water is a bad idea.
Knowledge is having an understanding of the "rules".
The terms Data, Information, Knowledge, and Wisdom are sometimes presented in a form that
suggests a scale.
Figure 1.1.
Data, Information, knowledge, wisdom along a scale
Information Processing
Information processing is the change (processing) of information in any manner detectable by an
observer. Information processing may more specifically be defined in terms by Claude E. Shannon
as the conversion of latent information into manifest.Input, process, output is a typical model for
information processing. Each stage possibly requires data storage.
Figure 1.2.
Model of information processing
Now that computer systems have become so powerful, some have been designed to make use of
information in a knowledgeable way. The following definition is of information processing
The electronic capture, collection, storage, manipulation, transmission, retrieval, and presentation of information in the form of data, text, voice, or image and includes telecommunications and
office automation functions.
History and Classification of Computers
History of Computers
Webster's Dictionary defines "computer" as any programmable electronic device that can store, retrieve, and process data.
Blaise Pascal invents the first commercial calculator, a hand powered adding machine
In 1946, ENIAC, based on John Von Neuman model completes.The first commercially successful
computer is IBM 701.
A generation refers to the state of improvement in the development of a product. This term is also
used in the different advancements of computer technology. With each generation, the circuitry
has gotten smaller and more advanced than the previous generations before it. As a result of the
miniaturization, the speed, power and memory of computers has proportionally increased. New
discoveries are constantly being developed that affect the way we live, work and play. In terms of
technological developments over time, computers have been broadly classed into five generations.
The First Generation - 1940-1956
The first computers used vacuum tubes for circuitry and magnetic drums for memory, and were
often enormous, taking up entire rooms. They were very expensive to operate and in addition to
using a great deal of electricity, they generated a lot of heat, which was often the cause of
malfunctions. First generation computers relied on machine language to perform operations, and
they could only solve one problem at a time. Input was based on punched cards and paper tape,
and output was displayed on printouts.
The computers UNIVAC , ENIAC of the US and BESEM of the former Soviet Union are examples
of first-generation computing devices.
The Second Generation - 1956-1963
Transistors replaced vacuum tubes and ushered in the second generation of computers. Computers
becomed smaller, faster, cheaper, more energy-efficient and more reliable than their first-
generation predecessors. Second-generation computers still relied on punched cards for input and
printouts for output. High-level programming languages were being developed, such as early
versions of COBOL and FORTRAN.
The first computers of this generation were developed for the atomic energy industry.
The computers IBM-1070 of the US and MINSK of the former Soviet Union belonged to the
second generation.
The Third Generation - 1964-1971: Integrated Circuits
The development of the integrated circuit was the hallmark of the third generation of computers.
Transistors were miniaturized and placed on silicon chips, called semiconductors, which
drastically increased the speed and efficiency of computers. Users interacted with third generation
computers through keyboards and monitors and interfaced with an operating system, which
allowed the device to run many different applications at one time. Typical computers of the third
generation are IBM 360 (United States) and EC (former Soviet Union).
The Fourth Generation - 1971-Present: Microprocessors
The microprocessor brought the fourth generation of computers, as thousands of integrated
circuits were built onto a single silicon chip. What in the first generation filled an entire room
could now fit in the palm of the hand. The Intel 4004 chip, developed in 1971, located all the
components of the computer - from the central processing unit and memory to input/output
controls - on a single chip.
In 1981 IBM introduced its first computer for the home user, and in 1984 Apple introduced the
Macintosh. Microprocessors also moved out of the realm of desktop computers and into many
areas of life as more and more everyday products began to use microprocessors.
As these small computers became more powerful, they could be linked together to form networks,
which eventually led to the development of the Internet. Fourth generation computers also saw the
development of GUI (Graphic User Interface), the mouse and handheld devices.
The Fifth Generation - Present and Beyond: Artificial Intelligence
Fifth generation computing devices, based on artificial intelligence, are still in development,
though there are some applications, such as voice recognition, that are being used today. The use
of parallel processing and superconductors is helping to make artificial intelligence a reality.
Quantum computation and molecular and nanotechnology will radically change the face of
computers in years to come. The goal of fifth-generation computing is to develop devices that
respond to natural language input and are capable of learning and self-organization.
Classification of Computers
Computers are available in different shapes, sizes and weights, due to these different shapes and
sizes they perform different sorts of jobs from one another.
Mainframe and Super Computers
The biggest in size, the most expensive in price than any other is classified and known as super
computer. It can process trillions of instructions in seconds. Governments specially use this type
of computer for their different calculations and heavy jobs. This kind of computer is also helpful
for forecasting weather reports worldwide.
Another giant in computers after the super computer is Mainframe, which can also process
millions of instruction per second and capable of accessing billions of data. This computer is
commonly used in big hospitals, airline reservations companies, and many other huge companies
prefer mainframe because o