Fundamentals Of Computer Programming And IT

I am highly delighted to place in the hands of my esteemed readers the text of
“FUNDAMENTALS OF COMPUTER PROGRAMMING AND IT” in its revised
form.
This book is written for Engineering, M.Tech., M.C.A., M.Sc. (Computer Science),
B.C.A., B.I.T., B.Sc., P.G.D.C.A. and other diploma course students.
PART A of the book presents Fundamentals of Computer and IT in a simple
and easy to understand style. The subject matter thoroughly clears the doubts
(if any) of both a novice or an experienced computer user.
PART B of this book covers Basics of Programming Using C++. It presents
all the C++ programming topics from elementary to basics of file handling with properly
tested programming examples.
I have put my sincere efforts and knowledge to make you understand the subject
matter in simplest and easiest form. Valuable suggestions are always most welcome.
WISH YOU A GRAND SUCCESS in your examination, and a very bright future
in the field of Computer Science.

Chapter 1 Price: 2.99

Computer is perhaps the most powerful and versatile tool ever created by human being. In
todays world, the use of computers has increased so rapidly that we can no longer ignore
them. Computers influence our lives in one way or the other. These days we see computers
being used to perform several functions that have made our life easy. The list of services for
which computers are used is a long one.

Chapter 2 Price: 2.99

We know that a computer system consists of hardware and software. Software, or programs,
are instructions that tell the computer how to perform a task. System software enables
the application software to interact with the computer and helps the computer manage its
internal and external resources. Applications software is software that has been developed
to solve a particular problem for users.
In this chapter, we will discuss about operating system and GUI based operating
system Windows XP. A brief introduction to application software packages, MS-Word,
PowerPoint, MS-Excel will be provided. The Internet is a worldwide computer network
that connects hundreds of thousands of smaller networks. The evolution of Internet and
its applications and services will also be covered

Chapter 3 Price: 2.99

3.1 Need for Problem Solving and Planning a Program
A
program
is a sequence of instructions written in a programming language. There are
various programming languages, each having its own advantages for program development.
Generally every program takes an input, manipulates it and provides an output as shownin
Figure 3.1

Chapter 4 Price: 2.99

4.1 Introduction to C++ Language
Object Oriented Programming (OOP) is a way of organizing programs.
C++ is an object-
oriented programming language.
It was developed by Bjarne Stroustrup in 1983 at the
AT&T Bell Laboratories, New Jersey, USA. He found C lacking for simulations and
decided to extend the language by using additional features from his favourite language,
Simula 67
. Simula 67 was one of the earliest object-oriented languages. Bjarne Stroustrup
called it C with Classes originally. Strictly speaking, C++ is a superset of C: Almost
every correct statement in C is also a correct statement in C++, although the reverse is
not true. The name C++ (C plus plus) was given by
Rick Mascitti
where ++ is the C
increment operator. The version 1.0 became available commercially in 1985, version 2 in
1989 and versions 3 in 1992. C++ evolved to cope with problems encountered by users,
and through discussions at AT&T. In fact, the maturation of the C++ language was
attested to by the
two
events given below:

Chapter 5 Price: 2.99

5.1 Operators
The C++ language provides a number of operators. These operators are used in different
combinations to form expressions. For example, the symbol  is a subtract operator that
subtracts two data items called
operands.
An
operator
can be defined as a symbol that
specifies an operation to be performed. The data items on which the operators act upon are
called operands.
Some operators require a single operand while others might require two
operands to act upon. The order in which the operations are performed by the operators
is known as the
order of precedence.
Let us get ourselves familiar with these different
categories of operators available in C++ language.

Chapter 6 Price: 2.99

6.1 Introduction
All the input and output operations are supported by the
istream
(input stream) and
ostream
(output stream) classes.
The identifier
cout
(pronounced see-out) is a predefined object in C++ that corresponds
to the standard output stream (A stream is simply a sequence of bytes).
The identifier
cin
(pronounced see-in) is a predefined object in C++ that corresponds
to the standard input stream.
In this chapter, we will discuss about input/output using extraction (>>) and insertion
(<

Chapter 7 Price: 2.99

7.1 Introduction
Every C++ program must have at least one function called
main( ).
When you run a C++
program, the first statement executed will be at the beginning of function
main( )
and the
last statement at the end of function
main( ).
Therefore, the
main( )
function is also known
as driver function as it drives the program. If there is no function called
main( )
in your
program, the linker will signal an error.
In most C++ programs, as we will see later,
main( )
calls other functions. The parentheses
following the word
main
are the distinguishing feature of a function. Without the parentheses
the compiler would treat
main
as a variable or some other program element.

Chapter 8 Price: 2.99

7.1 Introduction
Every C++ program must have at least one function called
main( ).
When you run a C++
program, the first statement executed will be at the beginning of function
main( )
and the
last statement at the end of function
main( ).
Therefore, the
main( )
function is also known
as driver function as it drives the program. If there is no function called
main( )
in your
program, the linker will signal an error.
In most C++ programs, as we will see later,
main( )
calls other functions. The parentheses
following the word
main
are the distinguishing feature of a function. Without the parentheses
the compiler would treat
main
as a variable or some other program element.

Chapter 9 Price: 2.99

A
function
groups a number of program statements into a single unit and gives it a name.
This unit can be called (invoked) from other parts of the program. Functions are the
building blocks of C++ programs where all the program activity occurs.
All C++ compilers come with a standard library functions that perform most commonly
needed tasks. Turbo C++ has a set of functions. More about library functions later on.
Let us learn to code functions as per our need
i.e.,
User Defined Functions Figure 8.1
shows an outline of using the user defined functions.

Chapter 10 Price: 2.99

9.1 Introduction
So far we have used C++ basic data types. C++ provides the
derived
data types also,
which are built from the basic integer and floating data types. An array is a C++
derived
type that can store several values of one type.
An array is a collection of homogeneous
(same type) elements that are referred by a common name.
It is also called a
subscripted
variable
as the array elements are used by the name of an array and an index or
subscript.
In C++, all arrays consist of
contiguous memory locations
. The lowest address corresponds
to the first element and the highest address to the last element. Arrays can store data
items of simple types like
int
or
float
or even of user-defined types like structures and
objects.

Chapter 11 Price: 2.99

10.1 Introduction to Object-Oriented Programming
Object-Oriented Programming (OOP) was developed because limitations were discovered in
earlier approaches to programming. A recent trend in programming methodology is OOP
where the real world is represented by objects. An object is a combination of data structures
and procedures that operate upon or extract information from these data structures. Imagine
you are programming in a traditional third-generation language, such as BASIC, creating
your coded instructions one line at a time. As you work on some segment of the program
(such as how to compute overtime pay), you may think, I will bet some other programmer
has already written something like this. Wish I had it. It would save a lot of time. Fortunately,
a kind of recycling technique now exists. This is object-oriented programming

Chapter 12 Price: 2.99

Implementation of Object Oriented Programming Concepts in C++
C with classes was the original name given by the originator, Stroustrup initially, which
nowadays is popularly known as C++. Classes and objects are the most important features
of C++. The class implements OOP features and ties them together. A structure groups
different type of elements and a function organizes the program actions to perform the
desired task.

Chapter 13 Price: 2.99

The first electronic computers were used for calculations in scientific applications. The
volume of data in these applications was very small and the number of computations were
very large in number. Later on, it was realized that computer could be useful for business
applications such as payroll, banking, railway and airline reservation, inventory control,
design work etc. where the volume of data is very large in comparison to scientific applications.
The program and data must be brought into main memory before processing takes place.
The computer memory being limited so the entire data may not even fit into main memory. Even
if, it fits into memory, the entire data is not processed at a time. Generally, only a small
amount of data is processed at a time, so why to keep the main memory occupied with
unnecessary data. The unused memory space can be utilized by other programs or data. The
above mentioned problems required the use of files.