1 © 2002 John Urrutia. All rights reserved. Qbasic Constructing Qbasic Programs.

Slides:



Advertisements
Similar presentations
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Advertisements

Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 1: Introduction
Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming.
Chapter 2- Visual Basic Schneider
COSC 120 Computer Programming
Program Flow Charting How to tackle the beginning stage a program design.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Sixth Edition by Tony Gaddis, Judy Walters,
Program Development and Programming Languages
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
COBOL for the 21 st Century Stern, Stern, Ley Chapter 1 INTRODUCTION TO STRUCTURED PROGRAM DESIGN IN COBOL.
Chapter 1 Program Design
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
1 Chapter 2 Problem Solving Techniques INTRODUCTION 2.2 PROBLEM SOLVING 2.3 USING COMPUTERS IN PROBLEM SOLVING : THE SOFTWARE DEVELOPMENT METHOD.
Chapter 3 Planning Your Solution
Fundamentals of C programming
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Introduction to Programming Lecture Number:. What is Programming Programming is to instruct the computer on what it has to do in a language that the computer.
Structured COBOL Programming, Stern & Stern, 9th edition
CIS Computer Programming Logic
CSC141 Introduction to Computer Programming
Technology in Action Alan Evans Kendall Martin Mary Anne Poatsy Twelfth Edition.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step.
CSC-115 Introduction to Computer Programming
1 © 2000 John Urrutia. All rights reserved. Qbasic Constructing Qbasic Programs.
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
Chapt. 10. What’s a Program? A set of instructions -- that lead to the accomplishment of an objective.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Chapter 2 Problem Solving On A Computer 2.1 Problem Solving Steps Solving a problem on a computer requires steps similar to those followed when solving.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
BACS 287 Programming Logic 1. BACS 287 Programming Basics There are 3 general approaches to writing programs – Unstructured – Structured – Object-oriented.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
1 Program Planning and Design Important stages before actual program is written.
Structured Programming (4 Credits)
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
The Art of Programming. The process of breaking problems down into smaller, manageable parts By breaking the problem down, each part becomes more specific.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 2: Input, Processing, and Output Starting Out with Programming Logic & Design by Tony Gaddis (with instructor modifications) 1-1.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
CHAPTER 3 COMPLETING THE PROBLEM- SOLVING PROCESS AND GETTING STARTED WITH C++ An Introduction to Programming with C++ Fifth Edition.
 Problem Analysis  Coding  Debugging  Testing.
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Chapter 1: Introduction to Computers and Programming
C++ First Steps.
Programming Languages
Lecture 1 Introduction Richard Gesick.
1-1 Logic and Syntax A computer program is a solution to a problem.
2008/09/22: Lecture 6 CMSC 104, Section 0101 John Y. Park
Chapter 2- Visual Basic Schneider
Lecture 2 Introduction to Programming
Algorithm Algorithm is a step-by-step procedure or formula or set of instruction for solving a problem Its written in English language or natural language.
An Introduction to Visual Basic .NET and Program Design
Chapter 1: Introduction to Computers and Programming
BASIC PROGRAMMING FOR DATA ANALYSIS
Designing and Debugging Batch and Interactive COBOL Programs
Problem Solving Techniques
VISUAL BASIC – CHAPTER ONE NOTES An Introduction to Visual Basic
Chapter 2- Visual Basic Schneider
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Flowcharts and Pseudo Code
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

1 © 2002 John Urrutia. All rights reserved. Qbasic Constructing Qbasic Programs

2 © 2002 John Urrutia. All rights reserved. Program Development Problem definition – statement  Who – The person, group, organization  What – The record, file, system, data  When – The timeframe  Where – The location  Why – The business reason

3 © 2002 John Urrutia. All rights reserved. Steps in Program Development 1. Clearly State the Problem  Data  Input – what are the data sources.  Output – what are the data sinks.  Process (algorithm)  Detailed description of how the Input is manipulated into Output.

4 © 2002 John Urrutia. All rights reserved. Data decomposition – the process of:  Identifying the required output.  Reports  Files  Identifying the raw input data needed to find a solution.  Can be an elementary data element  Can be a grouped data element Steps in Program Development

5 © 2002 John Urrutia. All rights reserved. The Algorithm – is the process  Sequence – linear execution of instructions  Selection – Identify a processing path  Binary  Case  Iteration – repetitive execution of instructions Steps in Program Development

6 © 2002 John Urrutia. All rights reserved. Steps in Program Development 2. Plan the Logic of the program  Use one or more of these to graphically represent the algorithm.  Flowchart  Pseudocode  Hierarchy chart

7 © 2002 John Urrutia. All rights reserved. Flowcharts  A graphical representation of the problem definition Process Decision Termination Manual Screen Steps in Program Development

8 © 2002 John Urrutia. All rights reserved. Hierarchy charts (Visual TOC)  A graphical representation of the functional decomposition Steps in Program Development Room Area Program Room Area Program Room Area Program Room Area Program

9 © 2002 John Urrutia. All rights reserved. Steps in Program Development Pseudocode  An English-like representation of the problem definition  IF the meat is green THEN move it to the waste bucket ELSE move it to the good bucket.

10 © 2002 John Urrutia. All rights reserved. Steps in Program Development 3. Code the program The syntactical exercise of converting the program design into a specific programming language. This should be done first on paper.

11 © 2002 John Urrutia. All rights reserved. Steps in Program Development 4. Key the program. Transfer the coded program into the QBASIC environment and save it as a QBASIC file.  MyProg.bas

12 © 2002 John Urrutia. All rights reserved. Steps in Program Development 5. Test and Debug the program.  V&V –Verification & Validation  Verification – Are we doing the right job?  Validation – Are we doing the job right?

13 © 2002 John Urrutia. All rights reserved. Steps in Program Development Specification errors –  Problem definition omissions, inaccuracies, lack of clarity Syntax errors –  Coding or Keying Logic errors  Do what I think not what I say…

14 © 2002 John Urrutia. All rights reserved. Steps in Program Development 6. Complete the Documentation  Develop a program package containing:  Program specification, hierarchy chart, flowchart, and pseudocode.  Test plan and results  Final version of tested program

15 © 2002 John Urrutia. All rights reserved. B. A. S. I. C. Beginners All-purpose Symbolic Instruction Code QBasic – QuickBASIC  Developed at Dartmouth in 1960’s

16 © 2002 John Urrutia. All rights reserved. Qbasic Character Set Letters: a-z and A-Z Digits: 0-9 Blank: the space character ( ) Special characters: + - * / \ =., ’ ” ( ) : ; ^ _ $ # ? ! % &

17 © 2002 John Urrutia. All rights reserved. Qbasic Keywords A keyword has a predefined meaning within Qbasic.  Examples: LET END REM PRINT

18 © 2002 John Urrutia. All rights reserved. The QBASIC Environment QBASIC is an interpreter  Each line of code is translated into machine language just prior to its execution… every time.  Creates an interactive environment that’s easy to work with.

19 © 2002 John Urrutia. All rights reserved. QBASIC …

20 © 2002 John Urrutia. All rights reserved. Demonstration

21 © 2002 John Urrutia. All rights reserved. The CLS statement CLear Screen  Erases all characters from the terminal  Places cursor at position 1,1 (top left corner)

22 © 2002 John Urrutia. All rights reserved. The PRINT statement Writes information to the terminal. PRINT output-list PRINT X$ PRINT PRINT “Hello World” PRINT (prints a blank line)

23 © 2002 John Urrutia. All rights reserved. The PRINT statement Horizontal spacing  Each PRINT statement will occupy one line on the users screen Vertical spacing  ; – places data adjacent to each other , – places data at multiples of 14 columns on the line