Chapter 1
Chapter 1
Chapter 1
Introduction to
Computers and C++
Chapter Objectives
• Introduce recent developments in the computer field
• Computer hardware, software and networking basics
• The data hierarchy
• The different types of programming languages
• Basic object-technology concepts
• Some basics of the Internet and the World Wide Web
• A typical C++ program development environment
3
Introduction
• C++ is a powerful computer programming language that’s appropriate for
technically oriented people with little or no programming experience, and for
experienced programmers to use in building substantial information systems
• You’ll write instructions commanding computers to perform different tasks
• Software (i.e., the instructions you write) controls hardware (i.e., computers)
• C++ allows object-oriented programming—a key programming methodology
• Good design is good business (Thomas J. Watson, Founder of IBM)
4
Introduction
• C++ is one of today’s most popular software development languages
• This text provides an introduction to programming in C++11—the latest version
standardized through the International Organization for Standardization (ISO)
and the International Electro-technical Commission (IEC).
• C++ is in use today by more than a billion general-purpose computers and
billions more cell phones, smartphones and handheld devices (such as tablet
computers)
5
Introduction
• Billions of computers such as desktops, laptops, and handheld smart
devices exist nowadays
• Smartphone sales surpassed personal computer sales back in 2011
• This explosive growth is creating significant opportunities for
programming in general and mobile apps in particular
6
Moore’s Law
• For many decades, hardware costs have
fallen rapidly
• Every year or two, the capacities of
computers have approximately doubled
inexpensively
• This trend often is called Moore’s Law,
named for the person who identified it
in the 1960s, Gordon Moore, co-
founder of Intel
15
Moore’s Law
• Moore’s Law and related observations apply especially to the amount of
memory that computers have for programs, the amount of secondary
storage (such as disk storage) they have to hold programs and data over
longer periods of time, and their processor speeds—the speeds at which
computers execute their programs (i.e., do their work)
• Similar growth has occurred in the communications field.
16
Computer Organization
• Regardless of differences in physical appearance, computers can be
envisioned as divided into various logical units or sections
17
18
19
20
21
Data Hierarchy
• Data items processed by computers form a data hierarchy that becomes
larger and more complex in structure as we progress from bits to
characters to fields, and so on.
22
23
24
25
26
C++
• C++ evolved from C, which was developed by Dennis Ritchie at Bell
Laboratories
•C
▫ Available for most computers and is hardware independent
▫ The widespread use of C with various kinds of computers (sometimes called
hardware platforms) led to many variations
▫ American National Standards Institute (ANSI) cooperated with the International
Organization for Standardization (ISO) to standardize C worldwide
▫ Joint standard document was published in 1990 and is referred to as ANSI/ISO
9899: 1990
33
C++
• C11
▫ Latest ANSI standard for the language
▫ Developed to evolve the C language to keep pace with increasingly powerful hardware and
ever more demanding user requirements
▫ Makes C more consistent with C++
C++
• C++ Standard Library
▫ C++ programs consist of pieces called classes and functions
▫ Most C++ programmers take advantage of the rich collections of
classes and functions in the C++ Standard Library
▫ Two parts to learning the C++ “world.”
The C++ language itself, and
How to use the classes and functions in the C++ Standard Library
▫ Many special-purpose class libraries are supplied by independent
software vendors
35
36
37
38
39
Programming Languages
• In this section, we provide brief comments on several popular
programming languages
40
41
42
43
44
45
46
Operating Systems
• Operating systems
▫ Software systems that make using computers more convenient for users,
application developers and system administrators
▫ Provide services that allow each application to execute safely, efficiently and
concurrently (i.e., in parallel) with other applications
▫ The software that contains the core components of the operating system is called
the kernel
▫ Popular desktop operating systems include Linux, Windows and OS X (formerly
called Mac OS X)
▫ Popular mobile operating systems used in smartphones and tablets include
Google’s Android, Apple’s iOS (for iPhone, iPad and iPod Touch devices)
68
Android
• Android
▫ Fastest growing mobile and smartphone operating system
▫ Based on the Linux kernel and Java
▫ Open source and free
▫ Developed by Android, Inc., which was acquired by Google in 2005
70