Solution Manual For Problem Solving and Programming Concepts 9 E 9th Edition 132492644 PDF
Solution Manual For Problem Solving and Programming Concepts 9 E 9th Edition 132492644 PDF
Computer
Chapter 2 introduces computer basics which all computer students need to know and understand.
Included are such concepts as constants, variables, data types, functions, operators, operator hierarchy,
expressions, and equations. This is one of the most important chapters in the book, since the information is
needed to use computers, whether as a programmer or as an end user.
Lecture Outline
I. Constants vs variables
A. Constant data, named and unnamed
B. Variable names and naming conventions
C. Rules for naming and using variables--see page 15
D. Value of a variable
II. Data types
A. Data vs Information
B. Data set
C. Numerical data
1. integers: whole numbers
2. real: all numbers
D. Character data: all characters
1. string: string of characters
2. concatenation: combining of strings
E. Logical data: true or false
F. Rules for data type usage
1. use correct data type
2. data types cannot be mixed
3. each data type has its own data set
4. all calculations use numerical data types
III. Data Storage
IV. Functions: ( a list of functions is included in the text)
A. Mathematical functions
B. String functions
C. Conversion functions
D. Statistical functions
E. Utility functions
F. Parameters: data required by a function
V. Operators
A. Operand
B. Resultant
C. Types: a chart is included in the text
1. Mathematical
2. Relational
3. Logical: a chart is included in the text
D. Hierarchy: a chart is included in the text
VI. Expressions and Equations
A. Assignment statement: use of the equals sign
B. Evaluation of expressions and equations—examples are included in the text
11
3. A CONSTANT is a specific value of any data type that does not change through out the processing of the
data. A VARIABLE is a value that can be changed during the processing of the data. A variable has an as-
signed memory location associated with the variable name.
4. a. CompanyName string
b. Item string
c. InventoryNo string
d. Quantity numeric--integer
e. Price numeric--real
f. Address string
g. OrderDate date
h. Reorder numeric--integer
i. Obsolete logical
6. A function is a small set of instructions built into a computer language or application that enables the user to
complete a frequently repeated task with fewer keystrokes than would be required without the function.
7. To increase productivity
8. The / symbol represents real division that results in a number and decimal parts. The \ symbol represents
modulo division that results in the whole number only--and integer-- and no decimal parts. The MOD rep-
resents the whole number remainder of a division.
9 / 4 = 2.25
9\4=2
9 MOD 4 = 1
9. a. 9 l. True
b. 5.0 m. 5.0
c. True n. False
d. 2 o. True
e. True p. 0
f. 25 q. True
g. False r. 64.0
h. False s. 6
i. 0 t. False
j. False u. False
k. 10 .0
12
13. a. An EQUAL SIGN means replaced by in an equation. b. Yes, as a relational operator it means equal to.
Problems
1. a. 8.5 d. 3
b. - 1.5 e. 3
c. 13.5
2. a. X = Y + 3 * Z - (Z + Y) / (Z - 3)
b. X = 5 * Y + (3 * Z- 1) / (4 * (3 * Z + 1) - Y)
c. X = (X - Y) ^ 2
3. a. Could be either--depending on the problem. Since there is only one vaiable on the left hand side this
could be either an assignment instruction or an expression to be used in another instruction.
b. Relational operator because there is an operator on the left hand side of the equals sign.
5. a. 24
b. 8
c. 10
d. 6
13
13. a. A B A OR B A B NOT A OR B
T T T T T F
T F T T F F
F T T F T F
F F F F F T
c. A B C R d. A B C R
T T T T T T T F
T T F T T T F F
T F T F T F T F
T F F F T T T F
F T T F F T T F
F T F F F T F F
F F T F F F T F
F F F F F F F T
e. A B C R
T T T F
T T F T
T F T T
T F F T
F T T F
F T F T
F F T T
F F F T
14
2. a. 5 b. 2
15