Lecture Roger Sutton CO331 Visual Programming 18: Program design 1.

Slides:



Advertisements
Similar presentations
Structured Design The Structured Design Approach (also called Layered Approach) focuses on the conceptual and physical level. As discussed earlier: Conceptual.
Advertisements

Lecture Roger Sutton CO331 Visual Programming 13: Multi-dimensional Arrays 1.
Lecture Roger Sutton 21: Revision 1.
PSEUDOCODE & FLOW CHART
靜宜大學資管系 楊子青 1 Programming Your App’s Memory 靜宜大學資管系 楊子青
Introduction to Programming Using simple games to convey introductory concepts MERLOT International Conference 2004 Tracey Jensen Assistant Professor,
Unit 251 Summary  Requirements may be represented in itemized format or in visual modeling (UML). Once the complete set of requirements are in our hand,
PLANNING THE TIC TAC TOE GAME BY NEEL DAVE. TIC TAC TOE INSTRUCTIONS Tic Tac Toe Instructions The basic concept of Tic Tac Toe 1.This is a game for two.
Tic Tac Toe Architecture CSE 5290 – Artificial Intelligence 06/13/2011 Christopher Hepler.
Top-Down Design CSC 161: The Art of Programming Prof. Henry Kautz 9/16/2009.
1 CSE1301 Computer Programming: Lecture 23 Algorithm Design (Part 1)
12 Pontoon1May Pontoon program CE : Fundamental Programming Techniques.
Lecture Roger Sutton CO331 Visual Programming 1: Module introduction and the programming environment 1.
Lecture Roger Sutton CO331 Visual Programming 16: Timer Control 1.
Lecture Roger Sutton CO331 Visual Programming 19: Simple file i/o Exceptions – Error handling 1.
Lecture Roger Sutton CO331 Visual programming 15: Debugging 1.
Lecture Notes 1/21/04 Program Design & Intro to Algorithms.
School of Computing Science CMT1000 © Ed Currie Middlesex University 1 CMT1000: Introduction to Programming Ed Currie Lecture 1B: Problem Solving.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic JavaScript: Functions Part I.
Chapter 1 Program Design
Lecture Notes 8/30/05 Program Design & Intro to Algorithms.
1 Case Study: Starting the Student Registration System Chapter 3.
© The McGraw-Hill Companies, 2006 Chapter 16 Two-dimensional arrays.
The Project AH Computing. Functional Requirements  What the product must do!  Examples attractive welcome screen all options available as clickable.
Lecture Roger Sutton 14: Data Management Facilities 1.
Lecture Roger Sutton CO357 Computing for Business and Accounting 7: Spreadsheet Documentation 1.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Lecture Roger Sutton CO357 Computing for Business and Accounting 13: Automation and Control (Macros and Form controls ) 1.
Lecture Roger Sutton CO530 Automation Tools 5: Class Libraries and Assemblies 1.
Programming Logic Program Design. Objectives Steps in program development Algorithms and Pseudocode Data Activity: Alice program.
08/09/ Arrays Defining, Declaring & Processing.
Simple Program Design Third Edition A Step-by-Step Approach
11 Finding Winners Using Arrays Session 8.2. Session Overview  Find out how the C# language makes it easy to create an array that contains multiple values.
VB Games: Preparing for Memory Brainstorm controls & events Parallel structures (again), Visibility, LoadPicture, User-defined procedures, Do While/Loop,busy.
Art 321 Lecture 7 Dr. J. Parker. Programming In order to ‘make things happen’ on a computer, you really have to program it. Programming is not hard and.
Selected Topics in Software Engineering - Distributed Software Development.
1 Modeling interactions and behavior Lecturer Dr. Mai Fadel.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 6 Using Methods.
Instructions To start a new game, click the “Start New Game” button. To reset the game in order to change the Answers and Questions on each slide, as.
Chapter 1 Program design Objectives To describe the steps in the program development process To introduce the current program design methodology To introduce.
Term 2, 2011 Week 1. CONTENTS Problem-solving methodology Programming and scripting languages – Programming languages Programming languages – Scripting.
Programming with Visual C++: Concepts and Projects Chapter 2B: Reading, Processing and Displaying Data (Tutorial)
Making Python Pretty!. How to Use This Presentation… Download a copy of this presentation to your ‘Computing’ folder. Follow the code examples, and put.
Two-Dimensional Arrays That’s 2-D Arrays Girls & Boys! One-Dimensional Arrays on Steroids!
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
UFCEKS-20-2Multimedia Authoring Times Table Quiz.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 18 – Student Grades Application Introducing.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
Computer Game Design ActionScript is… Object-oriented programming Everything you do in ActionScript does something to some object* Some objects.
+ TIC-TAC-TOE GAME CAPSTONE PROJECT SEN Team Members Sno.NameITU ID 1Keerthi Alimity Venkata Ganugapati Sujitha Sanku Bavi Bharathan87550.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Checkers A Matlab Project by Spenser Davison, Edward Dyakiw, Justin Pezzi, and Scott Wu.
Lives and Scoring Games Programming in Scratch. Games Programming in Scratch L2 Lives and Scoring Learning Objectives Define a variable Understand the.
Introduction to Computer Programming using Fortran 77.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
Introduction to Java. Java  An Object-Oriented, platform-neutral, secure language.  Object Oriented – software development method – a program is thought.
1 Agenda  Unit 8: Programs and Data. 2 Structured data - Array There are many situations where we want to apply the same processing to a collections.
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
YOU COMUTER WANT TO PLAY NOUGHTS AND CROSSES WELL NOW YOU CAN! JUST CLICK ON THE PLAY BUTTON BELOW AND YOU CAN BEGIN IF WINNER APPEARS BELOW CLICK ON IT.
3.01 Apply Controls Associated With Visual Studio Form
3.01 Apply Controls Associated With Visual Studio Form
Assembler, Compiler, Interpreter
Pixels.
Assembler, Compiler, Interpreter
Topics Graphical User Interfaces Using the tkinter Module
Software Development Process
4d – Program Design Lingma Acheson CSCI N331 VB .NET Programming
Presentation transcript:

Lecture Roger Sutton CO331 Visual Programming 18: Program design 1

CO331 Visual Programming Introduction When constructing a software solution a number of elements are addressed (These will become more sophisticated as knowledge and experience grows) 1. The user interface (Form1) 2. The program design (a)Class definition / construction / importation (b)Module definition / construction / importation (c)Interface methods (Form1 code) 3. Testing (a)Identify inputs (b)Identify outputs Construct test cases and form test plan 2

CO331 Visual Programming Example Consider the game of noughts and crosses played by two people (not against the computer ….yet!) The required program is to provide a platform to play the game by recording the ‘goes’, identifying a winner and keeping score. Accordingly we may envisage something similar to the game played with pencil and paper: 3 Score: Peter John

CO331 Visual Programming Form design Requires some knowledge of the implementation (programming language) to be aware of the facilities available. First thoughts! Questions? 4 Finish Score Player 1 Player 2 34 NoughtsCrosses Draw Are players to be identified? Do players take turns to be noughts and then crosses? Who starts? StartGame over – Crosses win

CO331 Visual Programming Form design – cont’d Label controls and, if significant, indicate names: 5 Finish Score Player 1 Player 2 34 NoughtsCrosses Abandon PictureBox: picbox Labels RadioButtons: rdbPlayer2 rdbPlayer1 Textboxes: txtPlayer1Score txtPlayer2Score Button: cmdFinish Button: cmdAbandon Start Label (Flashing) Play Button: cmdPlay Label: lblResult

CO331 Visual Programming Analysis Suppose : 1. The players are identified as Player 1 and Player 2, and Player 1 is identify before the program is run. 2. Player 1 - Crosses start 3. Play will alternate during a game and on the start of subsequent games 4. A game can be abandoned by clicking the ‘Abandon’ button Picture design: Use 50 pixel black and white squares located by top left vertex 6

CO331 Visual Programming Class design 1.Identify any class definitions to be imported:  Square 2.Identify any classes to be constructed and specify their members (a)a (chequered) Board display area show: to make the board visible (b)a Game – to record goes and check for winner display area entries: an integer array to store goes, -1 for nought and 1 for cross turns: to store number of turns taken getEntry: to retrieve a give entry value showSymbol: to draw symbol gameOver:to check for winner and indicate winning line or indicate draw 7

CO331 Visual Programming Class definitions Board 8

CO331 Visual Programming Class definitions – cont’d Game 9

CO331 Visual Programming Class definitions – cont’d Game – cont’d 10

CO331 Visual Programming Form1 methods Brainstorm what operations need to carried out and order them: Initialisation  Set initial values of global (?) variables, E.g. scores  Set up interface Start game  Initialise variables specific to a particular game, E.g. record of goes, number of turns  Display board Flash prompt Manage a ‘go’ 11

CO331 Visual Programming Form1 methods – cont’d Decide how methods will be invoked: click-handler, call from within some other method? Initialisation - MyBase.Load Start game - cmdPlay Flash prompt - Timer1.Tick Manage a ‘go’- picBox.MouseDown Check for a win - Game method/function Identify winner - Game method/function In this way the problem is broken down into smaller subtasks. Tackle each of these subtasks; if necessary, develop their solution in separate projects. Assemble the whole and adjust to work. This might mean going back and modifying some of the constituent components. 12 Run

CO331 Visual Programming Review code Revisit the code to Eliminate redundancy Make more readable/intelligible by restructuring, breaking large methods into smaller parts, consider introducing functions Check the need for global variables and where possible make local Introduce comments if not already present. Perform tests to identify problems, deficiencies, etc. Each time you complete a set of changes, re-run all test cases. 13

CO331 Visual Programming Looking for deficiencies Manage a ‘go’ 14

CO331 Visual Programming Example - deficiency What happens if a player selects an occupied cell? What will happen if player continues after game has been won? - Need to identify and prohibit these situations. Accordingly, we have 15

CO331 Visual Programming Deficiency – cont’d and: 16 Run