Computer Science 30
4.0-Programming & Design
 

Unit 4: Experience with Programming
           and Design - Advanced

Procedural and Object-Oriented Programming

Overview: In the last unit we reviewed many of the concepts used to design and run computer programs. In unit four we will explore the differences between procedural and object-oriented programming (OOP). Use Visual Studio to create a console-based application. This may be new for some students but really it's a throw-back to a time before Windows graphic user interface was available. It looks and feels like DOS (Disk Operating System). For now it's useful in demonstrating some key concepts.

  1. Start Visual Basic.NET
  2. In the New Project dialog, select "Visual Basic Projects", select "Console Application" as your template and name the project U4_ConsoleApp.
  3. The window that opens should look like this.

In a procedure driven program, the "Main" part of the program listing controls how the program executes. To begin we are just going to input an employee's name and gross salary and echo these back to the user. We'll use the "divide and conquer" technique of the top-down design model to break the task into manageable chunks of code and practice parameter passing. Type in the following functions and procedures below the Module Module1 and above the Sub Main() statement.

©Copyright Saskatoon Public Schools 2005 --- Page updated Friday, 2006-05-12 9:53 AM