Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming.

Slides:



Advertisements
Similar presentations
Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do.
Advertisements

CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
Computers Are Your Future
Programming Types of Testing.
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
زبانهای برنامه سازی برنامه سازی پیشرفته ارائه دهنده دکتر سيد امين حسيني E.mail: Home page:
Steps in Program Development Introduction to VBA.
CIS105 Chapter 1 Theory Review. Page 2 Hardware and Software are the two major components o any computer system Hardware is the set of physical devices.
Computers: Tools for an Information Age
Chapter 1 Program Design
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Programming. Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the.
Copyright © 2001 by Wiley. All rights reserved. Chapter 3: Variables, Assignment Statements, and Arithmetic Variables Assignment Statements Arithmetic.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Your Interactive Guide to the Digital World Discovering Computers 2012.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
CCSA 221 Programming in C CHAPTER 2 SOME FUNDAMENTALS 1 ALHANOUF ALAMR.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
Programming Languages: Telling the Computers What to Do Chapter 16.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Introduction to Visual Basic (VB)
Learning Objectives Data and Information Six Basic Operations Computer Operations Programs and Programming What is Programming? Types of Languages Levels.
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
Technology in Action Alan Evans Kendall Martin Mary Anne Poatsy Twelfth Edition.
Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition.
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
CMPE13Cyrus Bazeghi 1 Programming Languages Telling computers what to do.
Computer Programs and Programming Languages What are low-level languages and high-level languages? High-level language Low-level language Machine-dependent.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Basic of Programming Language Skill Area Computer System Computer Program Programming Language Programmer Translators.
Copyright © Prentice Hall Programming and Languages Chapter 14 Telling the Computer What to Do.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
McGraw-Hill/Irwin Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 4 Computer Software.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
1.
Chapter One An Introduction to Programming and Visual Basic.
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
Programming and Languages Dept. of Computer and Information Science IUPUI.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
Chapter 1: Introduction to Computers and Programming.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
CIS 365: Visual Application Development Introduction to Computers and Programming.
Component 1.6.
Introduction to Programming and Visual Basic
CSCI-235 Micro-Computer Applications
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
An Introduction to Programming and VB.NET
TRANSLATORS AND IDEs Key Revision Points.
Computer Programming.
Chapter 1 Introduction(1.1)
Chapter 2- Visual Basic Schneider
Chapter One: An Introduction to Programming and Visual Basic
Programming.
Introduction to Computer Programming
Programming Logic and Design Eighth Edition
Presentation transcript:

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 1 Chapter One: An Introduction to Programming and Visual Basic

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 2 Learning Objectives Understand the importance of information systems in organizations. Discuss the role of computer programs and programming in information systems. List and discuss the six computer operations. Describe the difference between modern Windows- based computer languages and older procedural languages. Discuss the difference between compiled and interpreted languages. List and discuss the steps in the object-oriented, event-driven programming process.

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 3 Data and Information Data are raw facts Examples of data include transactions, dates, amounts, etc. Information are data that have been processed into a usable form Information includes tables, documents, charts, etc. Goal of computer applications is to process data into information

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 4 Six Basic Computer Operations 1. A computer can receive (input) data 2. A computer can store data in memory 3. A computer can perform arithmetic and manipulate text strings 4. A computer can compare the contents of two memory locations and select one of two alternatives 5. A computer can repeat a group of operations 6. A computer can output information (processed data) We will use pseudocode statements to demonstrate these six operations.

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 5 Computer Operations

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 6 Programs and Programming A program is a very specific set of rules that tell the computer which switches should be "ON" or "OFF". The process of creating a program is called programming. The computer only knows what it is told through programs, so they must be accurate and very specific.

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 7 What is Programming? Deciding if there is a task to be accomplished or problem to be solved using a computer, e.g., is there a need for a program? Determining the nature of the task or problem, e.g., what must the program do? Developing a plan that will accomplish the task or solve the problem, e.g., generating the step-by-step process that the program will follow (algorithm). Converting the plan into a computer language program Testing the program to ensure it accomplishes task or solves problem defined earlier. Implementing the program to accomplish the task or solve the problem.

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 8 Types of Computer Languages Procedural: Monolithic programs that run from start to finish with no intervention from user other than input Basic, QBasic, QuickBasic COBOL FORTRAN C Object Oriented/Event Driven (OOED): Programs that use objects which respond to events; use small segments to code for each object Visual Basic Visual C++

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 9 Levels of Computer Languages Low Level: at the level of the computer, i.e., in binary (0-1) format Computer can only execute a binary form of a program Intermediate Level: close to the computer but uses English words or mnemonics, e.g., Assembler, that is converted directly into binary High Level: at the level of the programmer using English words and clearly defined syntax; must be converted or translated into binary for computer to implement it, e.g., Visual Basic Need a software program to handle the conversion of high-level into binary

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 10 Translating from High-level Language to Binary Interpreted: each statement translated as it is executed--slow but easy to use Compiled: entire program is converted to binary--executes faster, but more difficult to use (.exe files are compiled programs) VB is interpreted during creation and testing but can then be compiled into an.exe file

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 11

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 12 Object-Oriented Event-driven Programming (OOED) OOED uses objects, or self contained modules that combine data and program code which pass strictly defined messages to one another. OOED is easier to work with, because it is more intuitive than traditional programming methods. Visual Basic is an OOED language. Users can combine the objects with relative ease to create new systems or extend existing ones. Properties of objects are attributes associated with an object. Methods of objects are those activities that the object can carry out. Objects respond to events.

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 13 OOED Programming Process A six step process for writing an OOED computer program: 1. Define problem. 2. Create interface 3. Develop logic for action objects 4. Write and test code for action objects 5. Test overall project 6. Document project in writing No matter how well a program is written, the objective is not achieved if the program solves the wrong problem.

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 14 Step One: Define Problem Before you can create a computer application to solve a problem, you must first clearly define it. This may involve a study of the problem to understand the inputs and outputs. Must identify the data to be input to the program and the results to be output from it. Sketching an interface is a good way to understand the problem and to communicate your understanding to other people. Denote input and output objects as well as action objects-- those for which code (instructions) are needed.

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 15 Sketch of Vintage Video Interface

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 16 Step Two: Create Interface Once you have defined problem and sketched interface, you are ready to create interface. Doing this with VB is quite easy--select objects and place them on VB form following sketch. For Vintage Video, only need three objects: –buttons for action –textboxes for input and output –labels for descriptors

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 17 Vintage Video Interface

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 18 Step Three: Develop Logic for Action Objects Need to think about what each action object should do in response to an event This is the logic for each object Use Input/Processing/Output (IPO) Tables and Pseudocode to develop the logic IPO Tables show the inputs, outputs, and the processing to convert inputs into outputs

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 19 IPO Table for Calculate Button

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 20 Using Pseudocode An important part of the developing the logic for action objects is generating corresponding pseudocode. Pseudocode involves actually writing a program in English rather than in a computer language. When the actual computer program is written, the pseudocode is translated into computer language. A pseudocode program is useful for two reasons: –The programmer may use it to structure the algorithm's logic in writing. –It provides a relatively direct link between the algorithm and the computer program

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 21 Pseudocode for Calculate Button Begin procedure Input Video Price Taxes = 0.07 x Video Price Amount Due = Video Price + Taxes Output Taxes and Amount Due End procedure

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 22 Step Four: Write and Test Code of Action Objects Once you learn the vocabulary and syntax of a language, you should be able to convert the logic embodied in the pseudocode into a computer language. In our case, we use VB. You need to test each code for each action object as they are created. Once the object code is written, the programmer must test and correct it. This stage is referred to as debugging, since it involves removing "bugs". Use test data for which you know the correct answer to test the object code.

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 23 Private Sub cmdCalc_Click() ‘ This object calculates the Taxes and Amount ‘ Due given the Video Price Dim curPrice as Currency, curTaxes as Currency Dim curAmountDue as Currency curPrice = Val(txtVideoPrice.Text ) curTaxes = 0.07* curPrice curAmountDue = curPrice + curTaxes txtTaxes.Text = Str(curTaxes) txtAmountDue.Text = Str(curAmountDue) End Sub VB Code for Calculate Button

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 24 Step Five: Test Overall Project Even with extensive testing, some bugs can often be found in most commercial software. With computer software, each program instruction must be absolutely correct. Otherwise, the whole program might fail. BE SURE to test your program in the actual environment and on the actual data on which it will be used (just ask IBM at the Olympics).

Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming Process Developing Logic Introduction to Programming with Visual Basic 6.0 by McKeown and Piercy 25 Step Six: Document Project in Writing Documentation includes the pictorial and written descriptions of the software. It contains internal descriptions of programming commands and external descriptions and instructions. Documentation is necessary since, sooner or later, the program will need to be maintained (correct bugs, add new features, handle problems not thought of previously, etc. This is NOT possible without documentation. Written documentation includes books, manuals, and pamphlets that give instructions on software use and discuss the objectives and logic of the software.