Home > Articles > Programming > Visual Basic

Introduction to Problem Solving and Control Statements in Visual Basic 2010

  • Print
  • + Share This
Before writing a program to solve a problem, you should have a thorough understanding of the problem and a carefully planned approach. In this chapter, you will learn the theory and principles of structured programming with control statements.
This chapter is from the book
  • Let's all move one place on.
  • Lewis Carroll
  • The wheel is come full circle.
  • William Shakespeare
  • How many apples fell on Newton's head before he took the hint?
  • Robert Frost

4.1 Introduction

Before writing a program to solve a problem, you should have a thorough understanding of the problem and a carefully planned approach. When writing a program, it's also important to know the available building blocks and to use proven program-construction principles. In this chapter and the next, we present the theory and principles of structured programming with control statements. We introduce the If...Then, If...Then...Else, Do While...Loop, While...End While and Do Until...Loop statements—five of the building blocks that allow you to specify the logic required for methods to perform their tasks. We introduce the ListBox control and use it to display and process data, such as a list of grades in a class-average program. We also demonstrate how to "stack" and "nest" control statement to solve problems. The chapter concludes with an introduction to the Visual Studio debugger. You'll learn how to view the values of variables during a program's execution, how to step through code one statement at a time and how the debugger can help you locate logic errors in your programs.

  • + Share This
  • 🔖 Save To Your Account