ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Feb 10th, 2009 Introduction to Programming.

Slides:



Advertisements
Similar presentations
Communicating in Code: Layout and Style Programming Studio Spring 2012 Note: several examples in this lecture taken from The Practice of Programming by.
Advertisements

Internal Documentation Conventions. Kinds of comments javadoc (“doc”) comments describe the user interface: –What the classes, interfaces, fields and.
Programming Logic and Design Fourth Edition, Introductory
Flow Control if, while, do-while Juan Marquez (03_flow_control.ppt)
Introduction to Programming Using simple games to convey introductory concepts MERLOT International Conference 2004 Tracey Jensen Assistant Professor,
Communicating in Code: Layout and Style Programming Studio Spring 2009 Note: several examples in this lecture taken from The Practice of Programming by.
ITEC113 Algorithms and Programming Techniques
Debugging Introduction to Computing Science and Programming I.
Defining classes and methods Recitation – 09/(25,26)/2008 CS 180 Department of Computer Science, Purdue University.
Software Engineering and Design Principles Chapter 1.
CS107 Introduction to Computer Science Loops. Instructions Pseudocode Assign values to variables using basic arithmetic operations x = 3 y = x/10 z =
Control Flow C and Data Structures Baojian Hua
Chapter 6 - Repetition. Introduction u Many applications require certain operations to be carried out more than once. Such situations require repetition.
Wednesday, 10/9/02, Slide #1 CS 106 Intro to CS 1 Wednesday, 10/9/02  QUESTIONS ??  Today:  Discuss HW #02  Discuss test question types  Review 
Introduction to Computers and Programming Class 6 Introduction to C Professor Avi Rosenfeld.
16/27/ :53 PM6/27/ :53 PM6/27/ :53 PMLogic Control Structures Arithmetic Expressions Used to do arithmetic. Operations consist of +,
Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, © Copyright 2010, All Rights Reserved 1.
Tutorial 4 Decision Making with Control Structures and Statements Section A - Decision Making JavaScript Tutorial 4 -Decision Making with Control.
Guide To UNIX Using Linux Third Edition
Chapter 2: Developing a Program Extended and Concise Prelude to Programming Concepts and Design Copyright © 2003 Scott/Jones, Inc.. All rights reserved.
1 Chapter 2 Problem Solving Techniques INTRODUCTION 2.2 PROBLEM SOLVING 2.3 USING COMPUTERS IN PROBLEM SOLVING : THE SOFTWARE DEVELOPMENT METHOD.
JS Arrays, Functions, Events Week 5 INFM 603. Agenda Arrays Functions Event-Driven Programming.
Simple Program Design Third Edition A Step-by-Step Approach
General Programming Introduction to Computing Science and Programming I.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Structural Program Development: If, If-Else Outline.
Chapter 4: Decision Making with Control Structures and Statements JavaScript - Introductory.
Liang, Introduction to Programming with C++, Second Edition, (c) 2010 Pearson Education, Inc. All rights reserved Chapter 3 Selections.
1 Relational Expressions Relational expressions: –Expressions that compare operands –Sometimes called conditions –Evaluated to yield a result –Typically.
SE: CHAPTER 7 Writing The Program
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
BACS 287 Programming Logic 1. BACS 287 Programming Basics There are 3 general approaches to writing programs – Unstructured – Structured – Object-oriented.
Controlling Execution Programming Right from the Start with Visual Basic.NET 1/e 8.
Chapter 2 Functions and Control Structures PHP Programming with MySQL 2 nd Edition.
6/3/2016 CSI Chapter 02 1 Introduction of Flow of Control There are times when you need to vary the way your program executes based on given input.
Chapter 04 Control Statements: Part II. OBJECTIVES In this part you will learn: if…else Double-Selection Statement. while Repetition Statement.
Lecture 2 Numerical Methods for Engineering MECN 3500 Department of Mechanical Engineering Inter American University of Puerto Rico Bayamon Campus Dr.
CSCI 125 & 161 / ENGR 144 Lecture 8 Martin van Bommel.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 10 - JavaScript/JScript: Control Structures II Outline 10.1Introduction 10.2Essentials of.
SEM510 Autumn 1996 Software Engineering u What is “Software Engineering” ? u It involves: Software, People, Applications, Methods, Tools and Practices.
Written Presentations of Technical Subject Writing Guide vs. Term paper Writing style: specifics Editing Refereeing.
Data Structure Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2010.
The Department of Engineering Science The University of Auckland Welcome to ENGGEN 131 Engineering Computation and Software Development Lecture 2 Debugging,
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
Programming Language C++ Lecture 3. Control Structures  C++ provides control structures that serve to specify what has to be done to perform our program.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
CMSC 104, Section 301, Fall Lecture 18, 11/11/02 Functions, Part 1 of 3 Topics Using Predefined Functions Programmer-Defined Functions Using Input.
Introduction to Algorithmic Processes CMPSC 201C Fall 2000.
Control Structure  What is control Structure?  Types of Controls  Use the control structure in VBScript.  Example Summery.
Presentation By :- Nikhil R. Anande ( ) Electronic & Communication Engineering. 3 nd Year / 5 th Semester FACULTY GUIDE : RAHIUL PATEL SIR MICROCONTROLLER.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand how decisions are made in a computer ❏ To understand the logical.
IST 210: PHP Logic IST 210: Organization of Data IST2101.
Copyright © 2014 Pearson Addison-Wesley. All rights reserved. 4 Simple Flow of Control.
Structured Programming The Basics
Conditionals, Block Statements, Style
Introduction to Computing Science and Programming I
Selection—Making Decisions
Lecture 3- Decision Structures
Programming Problem steps must be able to be fully & unambiguously described Problem types; Can be clearly described Cannot be clearly described (e.g.
Chapter 4 – Control Structures Part 1
Programming Fundamentals
CS 240 – Lecture 11 Pseudocode.
Introduction Java Chapter 3.
Communicating in Code: Layout and Style
Introduction to Programming
Algorithm and Ambiguity
Creating Maintainable code
Creating readable code
Structural Program Development: If, If-Else
Presentation transcript:

ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Feb 10th, 2009 Introduction to Programming

STYLE PHILOSOPHY The principles of programming style are based on common sense guided by experience, not on arbitrary rules and prescriptions. Code should be clear and simple – straightforward logic, natural expression, conventional language use, meaningful names, neat formatting, helpful comments – and it should avoid clever tricks and unusual constructs. Consistency is important because others will find it easier to read your code, and you theirs.

PROGRAMMING STYLE NAMES – A name should be informative, concise, memorable, and pronounceable if possible. Much information comes from context and scope; the broader the scope of a variable, the more information should be conveyed by its name.

PROGRAMMING STYLE NAMES – ◦ Descriptive names for globals, short names for locals ◦ Be consistent – related things get related names to highlight their relationship ◦ Use active names for functions ◦ Be accurate.

PROGRAMMING STYLE EXPRESSIONS AND STATEMENTS ◦ Indent to show structure ◦ Use the natural form for expression ◦ Parenthesis to resolve ambiguity ◦ Break up complex expressions

CS TAPESTRY

PROGRAMMING STYLE CONSISTENCY – ◦ Use a consistent indention and brace style

PROGRAMMING STYLE COMMENTS – ◦ Don’t belabor the obvious ◦ Comment functions and global data ◦ Don’t comment bad code, rewrite it ◦ Don’t contradict the code

P

CS TAPESTRY

PROGRAM FLOW CONTROL Branches – (if block) ◦ Used to direct program flow through different cases based on tests. ◦ if/else blocks ◦ case blocks Loops – (for loop) ◦ Used to repeat a segment of code based on:  for loop – loops over a segment ‘for’ a specified number of times (counting loop).  while loop – loops over a segment ‘while’ a certain condition is true.

RELATIONAL LOGIC

COMBINATIONAL LOGIC

ERRORS Syntax – semi-colon left out. Runtime – array cell access beyond limit Logical – if/else not correct

DEBUGGING Examine the most recent change Don’t make the same mistake twice Read before typing Explain your code to someone else Print statements, print statements,…

TESTING Test as you write the code Systematic testing Test automation Stress tests

PROGRAM COMPONENTS Functions Subroutines Modules Classes, Objects

TOP-DOWN DESIGN

FLOW CHART

FLOW CHART EXAMPLE

PSEUDO-CODE