Sample Solution from
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Chapter 1
Problem 1TF
Try another sample solution

a.

Program Plan Intro

In 1642, the French philosopher and mathematician Blaise Pascal invented the calculating device called the Pascaline. It had eight movable dials on wheels and could calculate sums up to eight figures long. Both the abacus and Pascaline could perform only addition and subtraction operations.

Expert Solution
Program Description Answer

Pascaline had eight movable dials on wheels and could calculate sums up to eight figures long. Hence, the given statement is “True”.

Explanation of Solution

Pascaline had eight movable dials on wheels and could calculate sums up to eight figures long.

b.

Program Plan Intro

All programs must be loaded into main memory before they can be executed. Similarly, all data must be brought into main memory before a program can manipulate it.

Expert Solution
Program Description Answer

All programs must be loaded into the CPU before they can be executed and all data must be loaded into main memory before it can be manipulated. Hence, the given statement is “True”.

Explanation of Solution

All programs must be loaded into main memory before they can be executed. Similarly, all data must be brought into main memory before a program can manipulate it.

c.

Program Plan Intro

Main memory is an ordered sequence of cells, called memory cells. Each cell has a unique location in main memory, called the address of the cell.

Expert Solution
Program Description Answer

Main memory is an ordered sequence of cells but each cell does not have a random location in main memory. Hence, the given statement is “False”.

Explanation of Solution

Main memory is an ordered sequence of cells, called memory cells. Each cell has a unique location in main memory, called the address of the cell. These addresses help you access the information stored in the cell.

d.

Program Plan Intro

System programs control the computer. The system program that loads first when you turn on your computer is called the operating system. Without an operating system, the computer is useless. The operating system handles the overall activity of the computer and provides services.

Expert Solution
Program Description Answer

The program that loads first when you turn on your computer is called the operating system. Hence, the given statement is “True”.

Explanation of Solution

The system program that loads first when you turn on your computer is called the operating system. Without an operating system, the computer is useless.

e.

Program Plan Intro

There are two types of electrical signals: analog and digital. Analog signals are continuously varying continuous wave forms used to represent such things as sound. Audio tapes, for example, store data in analog signals. Digital signals represent information with a sequence of 0s and 1s.

Expert Solution
Program Description Answer

Analog signals do not represent information with a sequence of 0s and 1s. Hence, the given statement is “False”.

Explanation of Solution

Analog signals are continuously varying continuous wave forms used to represent such things as sound. Analog signals do not represent information with a sequence of 0s and 1s.

f.

Program Plan Intro

Digital signals are processed inside a computer, hence the language of a computer, called machine language, is a sequence of 0s and 1s. The digit 0 or 1 is called a binary digit, or bit.

Expert Solution
Program Description Answer

The machine language is a sequence of 0s and 1s. Hence, the given statement is “True”.

Explanation of Solution

Digital signals are processed inside a computer, hence the language of a computer, called machine language, is a sequence of 0s and 1s.

g.

Program Plan Intro

Digital signals are processed inside a computer hence the language of a computer, called machine language, is a sequence of 0s and 1s. The digit 0 or 1 is called a binary digit, or bit. The sequence of 0s and 1s is often referred to as a binary code or a binary number.

Expert Solution
Program Description Answer

A binary code is a sequence of 0s and 1s. Hence, the given statement is “True”.

Explanation of Solution

Machine language is represented as a sequence of 0s and 1s. The sequences are often referred to as a binary code or a binary number.

h.

Program Plan Intro

A sequence of eight bits is called a byte. A bit is a binary digit 0 or 1.

Expert Solution
Program Description Answer

A sequence of eight bits is called a byte. Hence, the given statement is “True”.

Explanation of Solution

A sequence of eight bits is called a byte.

i.

Program Plan Intro

One GB is 210 MB.

Expert Solution
Program Description Answer

One GB is not 220 MB. Hence, the given statement is “False”.

Explanation of Solution

One GB is 210 MB and not 220 MB. One GB equals 1024 MB and 1024 is equal to 210 hence one GB equals 210 MB.

j.

Program Plan Intro

The ASCII data set consists of 128 characters numbered 0 through 127. In the ASCII data set, the position of the first character is 0, the position of the second character is 1, and so on.

Expert Solution
Program Description Answer

In ASCII, A is the not the 65th character. Hence, the given statement is “False”.

Explanation of Solution

A is encoded as the binary number 1000001 and it is the 66th character in the ASCII character code. However, its position is 65 because the position of the first character is 0.

k.

Program Plan Intro

The number system that we use in our daily life is called the decimal system, or base 10. Computers represent everything as a sequence of 0s and 1s, that is, binary numbers, hence the number system that a computer uses is called binary, or base 2.

Expert Solution
Program Description Answer

The number system used by a computer is base 2. Hence, the given statement is “True”.

Explanation of Solution

Computers represent everything as a sequence of 0s and 1s, that is, binary numbers, hence the number system that a computer uses is called binary, or base 2.

l.

Program Plan Intro

An assembler is a program that translates a program written in assembly language into an equivalent program in machine language.

Expert Solution
Program Description Answer

An assembler translates the assembly language instructions into machine language. Hence, the given statement is “True”.

Explanation of Solution

Writing instructions in assembly language is easier that writing in machine language. A computer cannot execute assembly language instructions directly hence the instructions first need to be translated into machine language. A program called an assembler translates the assembly language instructions into machine language.

m.

Program Plan Intro

The compiler checks the source program for syntax errors and translates the program into the equivalent machine language, provided not syntax errors exist. The equivalent machine language program is called an object program.

Expert Solution
Program Description Answer

A compiler translates the source program into an object program. Hence, the given statement is “True”.

Explanation of Solution

A text editor is used to create a program following the rules, or syntax, of the high-level language and it is called the source code, or source program. The compiler checks the source program for syntax errors and translates the program into the equivalent machine language, provided not syntax errors exist. The equivalent machine language program is called an object program.

n.

Program Plan Intro

A computer can understand only machine language, in order to run this program successfully, the code must first be translated into machine language. There are many steps involved in doing so. One of the steps in case of C++ program is processing of preprocessor directives.

Expert Solution
Program Description Answer

In a C++ program, statements that begin with the symbol # are called preprocessor directives. Hence, the given statement is “True”.

Explanation of Solution

A C++ program typically contains the statement #include <iostream>. In a C++ program, statements that begin with the symbol # are called preprocessor directives. These statements are processed by a program called preprocessor.

o.

Program Plan Intro

A computer can understand only machine language, in order to run this program successfully, the code must first be translated into machine language. There are many steps involved in doing so. One of the steps in case of C++ program is translation of the source program into equivalent machine language.

Expert Solution
Program Description Answer

An object program is the machine language version of a high-level language program. Hence, the given statement is “True”.

Explanation of Solution

A text editor is used to create a program following the rules, or syntax, of the high-level language and it is called the source code, or source program. The compiler checks the source program for syntax errors and translates the program into the equivalent machine language, provided not syntax errors exist. The equivalent machine language program is called an object program..

p.

Program Plan Intro

A computer can understand only machine language, in order to run this program successfully, the code must first be translated into machine language. There are many steps involved in doing so. One of the steps in case of C++ program is translation of the source program into equivalent machine language which is known as the compilation process. A compiler is used for the compilation process.

Expert Solution
Program Description Answer

All logical errors, such as division by 0, are not reported by the compiler. Hence, the given statement is “False”.

Explanation of Solution

The compiler only checks for syntax errors such as missing brackets, out of scope function calls, etc. It does not guarantee that the program will run correctly. During execution, the program might terminate abnormally due to logical errors, such as division by zero. Such errors are not checked by the compiler.

q.

Program Plan Intro

Object Oriented Design (OOD) gets started with the identification of components called objects and their mutual interactions required to accomplish a functionality.

Expert Solution
Program Description Answer

In object-oriented design (OOD), a program is a collection of interacting objects. Hence, the given statement is “True”.

Explanation of Solution

In OOD, the first step in the problem-solving process is to identify the components called objects, which form the basis of the solution, and then to determine how these objects interact with one another. For example, in a program that automates the shopping cart process for a local store the two main objects are the shopping cart and the customer.

r.

Program Plan Intro

Object Oriented Design (OOD) gets started with the identification of components called objects and their mutual interactions required to accomplish a functionality.

Expert Solution
Program Description Answer

An object consists of data and operations on that data. Hence, the given statement is “True”.

Explanation of Solution

In OOD, the first step in the problem-solving process is to identify the components called objects, which form the basis of the solution. This is followed by the specification of the data for each object and the possible operations to be performed on that data. For example for a shopping cart the data would include item description, item price, item quantity and the operations would include checking the total value of the shopping cart, the presence or absence of an item in the cart, etc.

s.

Program Plan Intro

In the early 1990s a joint committee of the American National Standards Institute (ANSI) and International Organization for Standardization (ISO) was established to standardize the syntax of C++. In mid-1998, ANSI/ISO C11 language standards were approved. Most of today’s compilers comply with these new standards.

Expert Solution
Program Description Answer

ISO stands for International Organization for Standardization. Hence, the given statement is “True”.

Explanation of Solution

ISO stands for International Organization for Standardization and it played a big role in the standardisation of the syntax of C++ programming language.

Not sold yet?Try another sample solution