Preface
"Introduction to Programming in Visual BASIC 6.0" gives a careful and accessible introduction to programming in BASIC for the student wanting to understand what programming is all about and what programs like Excel are doing.
The text starts with simple output and proceeds to explain input, computer arithmetic, and decision making as the first tools for programming. When looping is introduced, some simple random number and computer graphics programming examples are studied. The last chapter introduces arrays to show the power of being able to reuse data items when new information is computed.
Students are helped in the learning process with frequent "On Your Own" text that helps students think about what has been introduced. All the syntax used is set apart in boxes to focus attention on the format that is required. "Putting It All Together" comprises a set of exercises at the end of each chapter. A web site will be maintained for answering questions and providing updates.
All the programming examples have been tested and run as written. The technical environment needed to execute a program is given as a few simple lines of code to enter into the code window as a kind of packaging for the programs the students will write. This approach works very well and gets the students programming very quickly.
Contents
Content
1. Introduction
2. Getting Started
1. Procedure For Starting
2. Printing the Program
3. Saving the Program
4. Reloading a Program
5. Exiting BASIC
6. Loading .txt Files
3. Screen Output
1. Programming Practices and Conventions
2. The REM Statement
3. The CLS Command
4. The Print Command
5. Print with a Semicolon
6. Print with a Comma
7. On Your Own
8. On Your Own
9. Positioning Output on the Screen
10. Summary
11. Putting It All Together
4. Input Values and Output Displays
1. Data Type Values
2. Variables
3. Assignment Statements
4. Dialog Boxes
5. Displaying Values
6. Numeric Values As Input
7. Creating Output Menus
8. Putting It All Together
5. Numeric Calculations
1. Operations, Functions and Expressions
2. Operation Hierarchy
3. Subexpressions
4. Built In Functions
5. Concatenation
6. Formatting Output
7. Putting It All Together
6. Decision Making
1. Simple Comparisons
2. Numeric Comparisons
3. Strings
4. Character Representation
5. Dictionary Ordering
6. String Comparisons
7. Conditional Statements
8. Simple If Blocks
9. The Else Option
10. Compound Conditional If Blocks
11. Multi-case If Blocks
12. Putting It All Together
7. Branching
1. Line Labels
2. Unconditional Branching
3. Repetition of Code
4. Conditional Branching
5. Repetition a Number of Times
6. Sentinels
7. Prompt and Echo
8. User Interrogation Technique
9. Putting It All Together
8. For .. Next Loops
1. The For .. Next Loop
2. The Step Parameter
3. Program Applications
4. Generalized Functionality
5. Nested Loops
6. Putting It All Together
9. Random Numbers
1. The Rnd Function
2. Using Randomize
3. Coin Tossing
4. Tossing a Biased Coin
5. Die Rolling
6. Scaling the Rnd Function
7. A Simulation
8. Putting It All Together
10. Graphics
1. Resolution and Color
2. Coloring Pixels
3. Drawing Lines
4. Using the PSet Command
5. Using the Line Command
6. Drawing Rectangles
7. Drawing Circles
8. Drawing Arcs
9. Drawing Sectors
10. Drawing Ellipses
11. Fill Styles
12. A Pie Chart
13. Histograms
14. Putting It All Together
11. Arrays and Tables
1. Defining an Array
2. The Syntax of Defining Arrays
3. Assigning and Using Values in an Array
4. Finding the Average and the Standard Deviation
5. File Input
6. Using Arrays – Searching an Array
7. Using Arrays – Finding a Smallest Element in an Array
8. Using Arrays – Interchanging Two Elements in an Array
9. Using Arrays – Sorting an Array
10. Using Arrays – Finding a Distribution of Elements
11. Using Arrays – Parallel Arrays
12. Using Arrays – Drawing A Pie Chart
13. Using Arrays – Drawing a Histogram
14. Putting It All Together
12. Index
13. Endnotes
Posting Komentar