Starting out with Programming Logic
and Design - Ch 2 Questions and
Answers
2.11 A string literal is usually enclosed inside a set of what characters? - ANSWER-
quotation marks
2.12 What is a variable? - ANSWER-a storage location in memory that is
represented by a name
2.13 Summarize three common rules for naming variables - ANSWER-- variable
names must be one word, no spaces
- in most languages punctuation characters cannot be used, stick to letters and
numbers
- in most languages first character of variable name cannot be a number
2.14 What variable naming convention do we follow in this book? - ANSWER-
camelCase
2.15 Look at the following pseudocode statement:
Input temperature
What happens when this statement executes? - ANSWER-- the program pauses and
waits for the user to type something on the keyboard, and the press the Enter button
- the the Enter key is pressed, the data that was typed is stored in the temperature
variable
2.16 Who is the user? - ANSWER-any hypothetical person that is using the program
and providing input for it
2.17 What is a prompt? - ANSWER-a message that tells or asks the user to enter a
specific value
2.18 What two steps usually take place when a program prompts the user for input?
- ANSWER-1. display a prompt on the screen
2. read a value from the keyboard
2.19 What does the term user-friendly mean? - ANSWER-used to describe programs
that are easy to use
2.20 What is an assignment statement - ANSWER-a statement that sets a variable
to a specified value
2.21 When you assign a value to a variable, what happens to any value that is
already stored in the variable? - ANSWER-it is replaced
and Design - Ch 2 Questions and
Answers
2.11 A string literal is usually enclosed inside a set of what characters? - ANSWER-
quotation marks
2.12 What is a variable? - ANSWER-a storage location in memory that is
represented by a name
2.13 Summarize three common rules for naming variables - ANSWER-- variable
names must be one word, no spaces
- in most languages punctuation characters cannot be used, stick to letters and
numbers
- in most languages first character of variable name cannot be a number
2.14 What variable naming convention do we follow in this book? - ANSWER-
camelCase
2.15 Look at the following pseudocode statement:
Input temperature
What happens when this statement executes? - ANSWER-- the program pauses and
waits for the user to type something on the keyboard, and the press the Enter button
- the the Enter key is pressed, the data that was typed is stored in the temperature
variable
2.16 Who is the user? - ANSWER-any hypothetical person that is using the program
and providing input for it
2.17 What is a prompt? - ANSWER-a message that tells or asks the user to enter a
specific value
2.18 What two steps usually take place when a program prompts the user for input?
- ANSWER-1. display a prompt on the screen
2. read a value from the keyboard
2.19 What does the term user-friendly mean? - ANSWER-used to describe programs
that are easy to use
2.20 What is an assignment statement - ANSWER-a statement that sets a variable
to a specified value
2.21 When you assign a value to a variable, what happens to any value that is
already stored in the variable? - ANSWER-it is replaced