Introduction to Programming
Lesson Plans & Calendars
Check Test Scores
Back to Computer Science Home Page
Course description
The languages presented in this course, MS-DOS QBasic
and Visual Basic are well-structured languages used on IBM PCs or PC-compatibles.
Structured problem solving is emphasized throughout this course, and problem solutions are
functionally decomposed with the aid of structure charts. Each programming chapter in the text ends with a comprehensive programming problem that ties
together new statements and concepts. This comprehensive problem is developed using
top-down design and is modularized with the aid of a structure chart. Short answer
'Learning Check' problems will be assigned after a topic is covered. Upon concluding a
chapter the student will be assigned programming problems which require implementing the
skills learned both in the current and in earlier chapters. The program will constitute
50% of the chapter grade. Upon completion of the programming assignment and review of the
chapter questions a chapter test will be given. It will constitute 50% of the chapter
grade.
The final quarter of the Programming 2 course will be
devoted to the development of a final programming
project. Students will form development groups of 3 or 4 and follow the prototype
method to produce a software package to meet the needs and specifications set forth by the
end user. The grade for the fourth quarter will be the average of all deliverable items
ranging from design specifications to final software product and user manuals.
The quarterly grades will be the average of the chapter
grades completed during the 10 week quarters. The grade for Programming 1 will consist of
40% quarter1 +40% quarter 2 and 20% of the Final Exam. The grade for Programming 2 will
consist of 40% quarter3 + 40% quarter 4 and 20% of the Final Exam. Students may choose to
take Programming 1 and not Programming 2.
The topics
covered and the objectives for each chapter are listed below.
Back to Computer Science Home Page
Chapter One
Outline
- Introduction
- What Computers Can Do
- The Components of a Computer System
- The Central Processing Unit
- Peripheral Devices
- Getting Started
- The Disk Operating System
- Using QBasic
- The Opening Screen
- The Menu Bar
- The Title Bar
- The Reference Bar
- The immediate Window
- The File Menu
- The View Menu
- The Run Menu
- Entering and Editing Programs
- Using the Mouse
Objectives
After studying this chapter, the Students will be able to:
- List the three kinds of tasks a computer can perform.
- Name the three features that make a computer useful.
- Explain the purpose of the central processing unit and
discuss its three components.
- Discuss the different input, output, and secondary
storage devices used with computer systems.
- Explain the purpose of the computer's operating
system.
- Access QBasic and identify the different parts of the
QBasic screen.
- Explain how to select commands from the QBasic menu
bar.
- Enter a simple program, store it on disk, and load it
back into the computer's main memory.
- Edit program statements.
Back to the top
Chapter Two
Outline
- Introduction
- Programming Languages
- Machine Language
- Assembly Language
- High-Level Languages
- Structured Programming
- Using Modules
- The Three Basic Logic Structures
- Structured Programming Languages
- The Programming Process
- Defining and Documenting the Problem
- Designing and Documenting a Solution
- Writing and Documenting a Program
- Debugging and Testing a Program
Objectives
After studying this chapter, the Students will be able to:
- Describe the three levels of programming languages.
- Discuss why structured programming was first
developed.
- Explain why structured programs are divided into
modules.
- Discuss the history of the BASIC language.
- List the four steps used in problem solving.
- Determine the needed input and output for simple
programming problems.
- Define the term algorithm and develop algorithms for
problem solutions.
- List the three basic logic structures.
- Draw structure charts for simple programming problem
solutions.
- Define top-down design and give three advantages of
using top-down design.
- Define flowchart and pseudocode.
- List and explain the purpose of the five flowcharting
symbols discussed in this chapter.
- Explain how the three basic logic structures are
represented in flowcharts.
Back to the top
Chapter Three
Outline
- QBasic Statement Components
- Constants
- Variables
- Keywords
- Simple QBasic Statements
- Clearing the Output Screen
- Documenting a Program
- Assigning Values to Variables
- Arithmetic Operations
- Displaying Results
- The END Statement
- The immediate Window
- Problem Definition
- Solution Design
- The Program
- Programming Hints & Debugging
Objectives
After studying this chapter, the Students will be able to:
- Differentiate between numeric and character string
constants and give examples of each.
- Use numeric and character string constants correctly
in programs.
- Explain how variables are used to store values in the
computer's main memory.
- List the rules for naming variables.
- Define the term keyword.
- Correctly document programs.
- Assign values to variables.
- Perform arithmetic operations using both constants and
variables.
- Evaluate arithmetic expressions according to the
hierarchy of operations.
- Display program output on the monitor screen.
- Use the Immediate window to. execute statements in
immediate mode.
- Use the various forms of help available with QBasic.
Back to the top
Chapter Four
Outline
- Storing Data in Variables
- Displaying Prompts for the User
- Placing Data in the Program
- Comparing the INPUT and READ/DATA Statements
- Formatting Results
- Semicolon
- Print Zones
- TAB Function
- SPC Function
- LOCATE Statement
- Sending Output to the Printer
- The PRINT USING Statement
- Placing Multiple Statements on a Single Physical Line
- Entering Data during Execution
Objectives
After studying this chapter, the Student will be able to:
- Use the INPUT statement to allow data to be entered
during program execution.
- Use the READ and DATA statements to enter data into
programs.
- Explain the advantages and disadvantages of each of
these methods of entering data.
- Write programs so that the output is formatted in a
readable way.
- Use commas and semicolons to format program output.
- Use the TAB and SPC functions to format output.
- Explain how the PRINT USING statement works and use it
in programs when appropriate.
Back to the top
Chapter Five
Outline
- The Block IF Statement
- Relational Operators
- The Double-Alternative Decision Structure
- The ELSEIF Clause
- Nesting Statements
- Indenting Control Structures
- The SELECT CASE Statement
- Menus
- Logical operators
- Programming Problem Definition & Solution Design
Objectives
After studying this chapter, the Student will be able to:
- Define the term control structures.
- Use block IF statements to create decision structures.
- Explain the difference between single-alternative and
double alternative decision structures.
- Explain the meaning of the relational operators and
use relational operators in expressions.
- Define the term collating sequence.
- Use the SELECT CASE statement in programs.
- Write programs using menus.
- Use the logical operators NOT, AND, and OR to check
for specific conditions.
Back to the top
Chapter Six
Outline
- Introduction
- An Example of a Simple SUB Procedure
- Typing in Procedures
- Passing Arguments to SUB Procedures
- LocalVariables
- Using Structure Charts to Modularize Programs
- Pass by Reference versus Pass byvalue
- Advantages of Using Procedures
- Using Stubs to Implement Programs
- The Edit Menu
- Selecting
- Cut
- Copy
- Paste
- Clear
Objectives
After studying this chapter, the Student will be able to:
- Write programs that use SUB procedures.
- Use structure charts to determine how programs should
be modularized.
- Correctly pass arguments in CALL statements to their
corresponding parameters in SUB procedures.
- Identify and explain the purpose of local variables.
- Use stubs in developing programs.
- Pass arguments either by reference or by value.
- List several advantages of modularizing programs.
- Use the Edit menu to move or copy portions of a
program from one location to another.
Back to the top
Chapter Seven
Outline
- Advantages of Loops
- The DO - - - LOOP
- The DO WHILE ... LOOP
- Controlling Loops
- The DO UNTIL ... LOOP
- The EXIT Statement
- The FOR ... NEXT Loop
- Rules for Using FOR ... NEXT Loops
- Nested Loops
- Comparing Loop Structures
Objectives
After studying this chapter, the Student will be able to:
- Explain the importance of loop structures.
- List the elements of a loop.
- Write programs using the DO WHILE LOOP and the DO
UNTIL ... LOOR
- Use trailer values to control loops.
- Write counting loops.
- Use the FOR ... NEXT loop appropriately in programs.
- Create nested loops.
- Determine which type of loop is appropriate in a
particular programming situation.
Back to the top
Chapter Eight
Outline
- Standard Functions
- Numeric Functions
- String Functions
- FUNCTION Procedures
- Writing User-Friendly Programs
- Learning Check 8-3
- Debugging and Testing
- Syntax Errors
- Logic Errors
- The Integrated Debugger
- Testing Methods
Objectives
After studying this chapter, the Student will be able to:
- Use the standard numeric functions INT, SQR, SGN, ABS,
and RND.
- Use the standard string functions LEN, LEFT$, RIGHT$,
MID$, LCASE$, UCASE$, ASC,
- CHR$, VAL, STR$, and DATE$.
- Use FUNCTION procedures to meet specific needs.
- Define the term user-friendly.
- Write user-friendly programs.
- Protect programs from invalid user input.
- Explain the difference between syntax and logic
errors.
- Use desk checking and program tracing to locate
errors.
- Test programs using correctly selected data.
Back to the top
Chapter Nine
Outline
- Subscripts
- Dimensioning an Array
- One-Dimensional Arrays
- Reading Data to an Array
- Printing the Contents of an Array
- Performing Calculations on Array Elements
- Two- Dimensional Arrays
- Reading and Printing Two-Dimensional Arrays
- Adding Rows
- Adding Columns
- Totaling a Two- Dimensional Array
- Sorting
- Bubble Sort
- Merge Sort
- Searching
- Sequential Search
- Binary Search
Objectives
After studying this chapter, the Student will be able to:
- Explain the purpose of subscripts.
- Use the DIM statement to dimension arrays.
- Read data to, print, and manipulate one- and
two-dimensional arrays.
- Sort arrays using the bubble sort.
- Use the merge sort to merge two sorted arrays.
- Search for data items in an array using both the
sequential and binary searches.
Back to the top
Chapter Ten
Outline
- Data Types
- Records
- Files
- File Organization
- File Access Methods
- Secondary Storage
- File Position Pointers
- Using Sequential Files
- Creating and Accessing a Sequential File
- Closing a File
- Writing to a Sequential File
- Appending Records to a Sequential File
- Reading from a Sequential File
- Using Random Files
- Creating a Random File
- Storing & Reading Records in a Random File
- Comparison of Random and Sequential Files
Objectives
After studying this chapter, the Student will be able to:
- Use the DIM statement to specify the data type of
variables.
- Define records and explain how records are different
from arrays.
- Use records in programs.
- List several advantages of using data files.
- Discuss the relationship between files, records, and
fields.
- Create a sequential file.
- Read from and write to a sequential file.
- Append data to the end of an existing sequential file.
- Create random files and define records to be used in
them.
- Access records in a random file.
- Add records to a random file.
- Compare random and sequential files.
Back to the top
Chapter
Eleven Outline
- Graphics
- Text Mode
- Graphics Modes
- Mixing Text and Graphics
- Graphics Commands
- The LOCATE Statement
- The PRESET and PSET Statements
- The LINE Statement
- The CIRCLE Statement
- The DRAW Statement
- Using Loops in Graphics
- Color Graphics
- Sound
- The BEEP Statement
- The SOUND Statement
- The PLAY Statement
Objectives
After studying this chapter, the Student will be able to:
- Define text mode and graphics mode.
- Explain how a system's graphics adapter is related to
the graphics screen modes that can be used with that machine.
- Create graphics images using the SCREEN, LOCATE, PSET,
PRESET, DRAW, LINE, CIRCLE, and COLOR statements.
- Create bar charts to illustrate program output.
- Create sound using the BEEP and SOUND statements.
- Create music using the PLAY statement.
Back to the top
Final Programming Project
In the final quarter of the Introduction to Programming
class we devote time to developing a software solution to a problem. The problems are
selected from faculty members, secretarial and custodial staff or other students. The
class is organized as a corporation and broken down into programming groups of three to
four students. Each group selects a programming problem from a list advertised on the
network. The group then follows the prototyping model of software development outlined
below.
- groups agree on the problem to be solved and on the
requirements;
- complete and document* preliminary interviews with the
customer;
- agree on project plans, including resource and time
constraints;
- present project plans to the user and refine the plans
according to customer input;*
- Produce design document 1* and agree on deadlines ;
- produce and test the first prototype;*
- begin to produce user documentation (users' manual);*
- evaluate the prototype and demonstrate it to the user ;
- document revisions and updates to be completed in the
second prototype*
- Produce the second prototype;*
- update documentation & users manual;
- evaluate the second prototype and demonstrate it to the
user ;
- if necessary, refine and test a third prototype;
- finish the users manual;*
- create a testing plan* and test the final product;
- obtain the users final approval and sign-off.*
(* represents a deliverable
object to be submitted for evaluation)
Every group will share their progress with the entire
class by presenting their work at regular intervals. These presentations called
walk-throughs will be used prior to submission of any deliverable item. These enhance the
capabilities of every group because they improve the quality of work, highlight errors
early on in development, and result in the cross-education of team members in all the
applications being developed. Also, application expertise is communicated, much work is
simplified, and technical progress is readily assessed.
A major deliverable from this process is the original
design specification suitable for use in program's development. Beginning programmers
usually fail to plan properly before they begin to write code. Emphasizing the design
specification forces students to properly devote an adequate amount of time to the
planning phase so that writing the code becomes more organized and efficient.
The evaluation or acceptance stage is the formal review
of each prototype and documentation of the lessons learned. It is a simple matter to
demonstrate the prototype. But these evaluations are not a one-way process. The most vital
element in the whole prototyping approach is obtaining and exploiting customer feedback.
It is very important that students recognize the need and plan for enough time to review
the prototype properly both among the programming group and in walk throughs with other
groups. The reviews also allow the project customer, the teacher and the programmers to
agree that the deliverables have been produced according to the outline requirements
definition and time planning documentation.
After each prototype is accepted a decision is made as
to how the programming effort will proceed. The design document is then updated and new
programming code is generated to produce the next prototype. This process is repeated
until the programmers and customer agree that the project is finished. The exact number of
prototypes necessary is not known until the project is completed. Students find that a
number of questions arise, such as how a team can control endless prototyping. There may
be the fear that users will get carried away, constantly changing their minds, opening up
the prospect of an endless, uncontrolled development cycle. The groups of student
programmers must make prudent decisions concerning time constraints and feasibility
factors if the project is to be delivered on time and within the constraints set forth in
the original design.
Finally, once the product is finished it must be placed
into service. The public installation on the network, publication of a users manual and
tidying up of any loose ends, such as exception handling rules and routines must all be
completed before the software is considered to be in service. The project is considered
complete only by mutual agreement of the customer, teacher and programming group. Once
this is established the requirements list can be signed off and a final grade for the
project is assigned.
Typical project milestones might include the following:
- complete design document 1;
- produce, test and present the first prototype;
- evaluate prototype and update design documentation
- produce test and present the second prototype;
- evaluate prototype and, if necessary, refine and test a
third prototype;
- produce the final design documentation;
- evaluate prototype;
- develop a test plan for the final product;
- produce user documentation (users manual);
- Place the software in service and obtain the user's
sign-off.
Experience with teaching the prototyping method
described suggests small teams of three or four at the most work best. There is no
specialization within the team. All members have completed the course of study in Qbasic
and Visual Basic but they are not systems analysts or experienced programmers at this
point. They are system builders expected to develop all the skills of building the system
from start to finish. They quickly realize that learning doesn't end simply because they
have finished formal classroom training in this subject. Students will find that they will
learn many skills related to programming and the human interaction of a workplace that
could not possibly be covered in a formal classroom setting .
Back to the top
Text Books
QBasic, Baumann - Mandell. 1992. West Publishing Company.
Visual Basic 4.0 Step by Step, 1995. Microsoft Press.
Revised: September 11, 2002.