Programming Logic and Design

advertisement
Programming Logic and Design
With Visual Basic .NET
By
Gary S. Popkin & Josephine Braneky
New York City Technical College, City University of New York
Outline
Reading in
textbook
Chapter 1.
a.
b.
c.
d.
What is programming
What is programming logic and design
What is Visual Basic
How applications get developed
i. The designer
ii. The programmer
iii. The user
iv. You
Chapter 2.
a.
b.
c.
d.
What you will learn in this course
Computer Essentials
Hardware
i. System unit
ii. Monitor
iii. Printer
iv. Diskette drive
v. Keyboard
vi. Mouse
Using the mouse
i. Mouse movement
ii. Mouse actions
iii. Using the mouse with application windows
1. Moving a window
2. Sizing a window
(a) Maximizing
(b) Minimizing
(c) Restoring
(d) Custom sizing
3. Scroll bars
Elements of word processing
i. Using Notepad
ii. Editing text
iii. Scrolling text
iv. Save and retrieving documents
Disks and folders
i. Hard disk
ii. Floppy diskette
iii. Using My Computer
Chapter 1
pgs. 8 - 14
pgs. 15 - 18
Chapter 3.
a.
b.
Why use programming tools
Developing an application
i. Understand the problem
ii. Plan the application
1. Plan the inputs
2. Plan the outputs
3. Plan the algorithms
(a) Principles of structured programming
(i) Sequence
(ii) Decision
(iii) Loop
(b) Tools for planning algorithms
(i) Pseudocode
(ii) Flowcharts
iii. Code the application
iv. Test the application
v. Deliver application to users
Chapter 4.
a.
b.
c.
d.
e.
b.
c.
pg.32
pg. 33
pg. 33
pg. 33
pg. 33
pgs. 35 - 36
pgs. 34 - 35
The Visual Basic Integrated Development Environment
Invoking Visual Basic
Starting a console application
Visual Basic windows
i. The code window
ii. Solution explorer
iii. The Build window
iv. The Debug window
v. Dynamic Help
First application: "Hello, world!"
Numeric application
Chapter 5.
a.
Programming tools
pg. 46
pg. 47
pg. 64
Variables and constants in Visual Basic
Numbers
i. Different forms of numeric storage
1. Integers
2. Long integers
3. Decimal fractions
4. Mixed numbers
ii. Numeric constants
iii. Arithmetic operations
iv. Numeric variables
v. Assignment
vi. Numeric functions
ii.
Strings
i. String constants
ii. String variables
iii. Concatenation
iv. String properties, methods, and functions
Using variables
i. Using Option Explicit
pgs. 74 - 75
pg. 80
pgs. 80 – 81
pgs. 90 - 91
pgs. 93 – 94
pgs. 95 - 98
ii. Using Option Strict
iii. Using the Dim statement
iv. Scope of variables
1. Variables declared in procedures
2. Module-level variables
Chapter 6.
a.
b.
c.
d.
Using data files stored on disk
i. Creating data files in Notepad
ii. Using Open, Input, and Close
iii. Using Open, Write, and Close
Formatting output
i. Printing in zones
ii. The Tab and Spc functions
iii. The Format function
iv. Printing to the printer
Examples of input and output
i. Reading, processing, and printing
ii. Accumulators and accumulating
1. Theory
(a) Accumulating data values
(b) Counting
2. Implementation in Visual Basic
Stepping through a program with accumulating
Chapter 7.
a.
b.
c.
d.
e.
General Procedures
Types of general procedures
Advantages of using general procedures
Theory of general procedures
Sub procedures
i. Without parameters
ii. With form-level variables
iii. Passing values to a sub procedure
iv. Passing values back from a sub procedure
v. Stepping through a program with a Sub procedure
Function procedures
i. Review of built-in Visual Basic functions
ii. User-defined functions
1. Using a function
2. Passing values to a function
3. Returning a value from a function
iii. Stepping through a program with a Function procedure
Chapter 8.
a.
b.
c.
More About Input and Output
Decisions
Forms of If decisions
If statements and If blocks in Visual Basic
Simple conditions
i. Relational operators with numbers and numeric variables
1. Theory
2. Implementation in Visual Basic
ii. Relational operators with strings and string variables
1. Theory
d.
e.
f.
g.
h.
2. Implementation in Visual Basic
Using And and Or
i. Theory
ii. Implementation in Visual Basic
Nested If statements
i. Theory
ii. Implementation in Visual Basic
Select Case
i. Theory
ii. Implementation in Visual Basic
Testing for ranges of values
i. Theory
ii. Implementation in Visual Basic
Decision tables
i. Constructing a decision table
ii. Implementing a decision table in Visual Basic
Chapter 9.
a.
b.
c.
d.
e.
f.
g.
Looping
Advantages of looping
Do loops
i. While loops
1. Theory
2. Implementation in Visual Basic
ii. Until loops
1. Theory
2. Implementation in Visual Basic
iii. With test before
1. Theory
2. Implementation in Visual Basic
iv. With test after
1. Theory
2. Implementation in Visual Basic
v. Stepping through a program with a Do loop
For…Next loops
i. Theory
ii. Implementation in Visual Basic
iii. Stepping through a program
Incrementing and decrementing in loops
i. Theory
ii. Implementation in Visual Basic
iii. Stepping through a program
Programming for efficiency in loops
Nested loops
i. Theory
ii. Implementation in Visual Basic
iii. Stepping through a program with nested loops
Using a loop to accumulate totals
i. Theory
ii. Implementation in Visual Basic
iii. Stepping through a program with accumulation
Chapter 10. Arrays
a.
Definition and examples of arrays
b.
c.
d.
e.
f.
g.
h.
How arrays are stored
How elements of an array are referenced
Using arrays in Visual Basic
Initializing arrays
i. In code
ii. From a file
Using parallel arrays
Sorting an array (bubble sort)
i. Theory
ii. Implementation in Visual Basic
iii. Stepping through a bubble sort
Searching an array
i. Searching for an exact match
ii. Searching for a range match
Chapter 11. Using Graphical User Interfaces
a.
b.
c.
d.
e.
Working with five objects
i. Form
ii. Placing controls on a form
1. TextBox control
2. Label control
3. CommandButton control
4. PictureBox control
iii. Moving and sizing objects
1. Using the mouse
2. Using the keyboard
iv. Using the properties window
1. Name property
2. Text property
Responding to user events
i. The code window
ii. Objects list
iii. Event procedures
iv. Stepping through an event procedure
The PrintForm method
Using TextBoxes for input
i. The Val function
ii. Assigning the contents of text boxes to variables
Using TextBoxes for output
Download