- 4.1 Introduction
- 4.2 Algorithms
- 4.3 Pseudocode
- 4.4 Control Structures
- 4.5 If...Then Selection Statement
- 4.6 If...Then...Else Selection Statement
- 4.7 Nested If...Then...Else Statements
- 4.8 Repetition Statements
- 4.9 Compound Assignment Operators
- 4.10 Formulating Algorithms: Counter-Controlled Repetition
- 4.11 Formulating Algorithms: Nested Control Statements
- 4.12 Using the Debugger: Locating a Logic Error
- 4.13 Wrap-Up
- Self-Review Exercises
- Answers to Self-Review Exercises
- Quick Quiz
- Making a Difference Exercises
Answer each of the following questions.
State whether each of the following is true or false. If false, explain why.
Write two different Visual Basic statements that each add 1 to Integer variable number.
Write a statement or a set of statements to accomplish each of the following:
Write a Visual Basic statement to accomplish each of the following tasks:
Combine the statements that you wrote in Exercise 4.5 into a program that calculates and displays the sum of the Integers from 1 to 10. Use a Do While...Loop statement to loop through the calculation and increment statements. The loop should terminate when the value of control variable number becomes 11.
Identify and correct the error(s) in each of the following (you may need to add code):
State whether each of the following is true or false. If the answer is false, explain why.