1 Chap 4. Data Should know Declare & Initialize variables Declare constants Assignment Operators Increment and Decrement Operators Precedence of Operators.

Slides:



Advertisements
Similar presentations
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 4 – Introducing Algorithms, Pseudocode and.
Advertisements

 2001 Deitel & Associates, Inc. All rights reserved. 1 Outline 14.1Introduction 14.2Algorithms 14.3Pseudocode 14.4Control Structures 14.5The if Selection.
Introduction to Computers and Programming Lecture 5 New York University.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 3 - Structured Program Development Outline.
Repetition Structures: For Loop Constants CSC 1401: Introduction to Programming with Java Week 5 Wanda M. Kunkle.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 4 - Program Control Outline 4.1Introduction 4.2The Essentials of Repetition 4.3Counter-Controlled.
1 Arithmetic in C. 2 Type Casting: STOPPED You can change the data type of the variable in an expression by: (data_Type) Variable_Name Ex: int a = 15;
Structured Program Development in C
CIS3931 – Intro to JAVA Lecture Note Set 3 19-May-05.
Control Structures Session 03 Mata kuliah: M0874 – Programming II Tahun: 2010.
 2003 Prentice Hall, Inc. All rights reserved.  2004 Prentice Hall, Inc. All rights reserved. Chapter 8 - JavaScript: Control Statements I Outline 8.1.
Advanced Programming Collage of Information Technology University of Palestine, Gaza Prepared by: Mahmoud Rafeek Alfarra Lecture 2: Major Concepts of Programming.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Structural Program Development: If, If-Else Outline.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
Chapter 4: Decision Making with Control Structures and Statements JavaScript - Introductory.
Lecture 4 Introduction to Programming. if ( grade ==‘A’ ) cout
1 4.8The do/while Repetition Structure The do/while repetition structure –Similar to the while structure –Condition for repetition tested after the body.
CSCI 3328 Object Oriented Programming in C# Chapter 5: C# Control Statement – Part II UTPA – Fall
1 Advanced Programming IF. 2 Control Structures Program of control –Program performs one statement then goes to next line Sequential execution –Different.
Programming in Java Unit 4. Learning outcome:  LO2: Be able to design Java solutions  LO3: Be able to implement Java solutions Assessment criteria:
Slide 1 PHP Operators and Control Structures ITWA 133.
C# Programming Fundamentals Control Flow Jim Warren, COMPSCI 280 S Enterprise Software Development.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Lucas Bang Lecture 5: Introduction to C: More Control Flow.
Repetition Structures Repetition Structures allow you to write programs that will repeat program steps multiple times. –Also called Loops –Counter controlled.
Chapter 3 - Structured Program Development Outline 3.1Introduction 3.2Algorithms 3.3Pseudocode 3.4Control Structures 3.5The If Selection Structure 3.6The.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 8 - JavaScript: Control Statements I Outline 8.1 Introduction 8.2 Algorithms 8.3 Pseudocode 8.4.
Lecture 2 Control Structure. Relational Operators -- From the previous lecture Relational Operator Meaning == is equal to < is less than > is greater.
Control Statements in C 1.Decision making statements 2.Looping statements 3.Branching statements
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
Fundamental Programming Fundamental Programming for Loops.
Control Structures - Selections - Repetitions/iterations (part 2) 1 -Based on slides from Deitel & Associates, Inc. - Revised by T. A. Yang.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
Loops cause a section of a program to be repeated a certain number of times. The repetition continues while a condition remains true. When a condition.
 2002 Prentice Hall. All rights reserved. 1 Chapter 4 – Control Structures Part 1 Outline 4.1 Introduction 4.2 Algorithms 4.3 Pseudocode 4.4 Control Structures.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
Dr. Qusai Abuein1 Internet & WWW How to program Chap.(7) JavaScript: Control Statements I.
C++ Programming Lecture 5 Control Structure I (Selection) – Part I The Hashemite University Computer Engineering Department (Adapted from the textbook.
1 Advanced Programming IF. 2 Control Structures Program of control –Program performs one statement then goes to next line Sequential execution –Different.
Chapter 7 Control Structures. Java has very flexible three looping mechanisms. You can use one of the following three loops:  while Loop  do...while.
Loops causes program to execute the certain block of code repeatedly until some conditions are satisfied. Suppose you want to execute some code/s 10 times.
PHP Condtions and Loops Prepared by Dr. Maher Abuhamdeh.
1 Chapter 4 - Control Statements: Part 1 Outline 4.1 Introduction 4.4 Control Structures 4.5 if Selection Structure 4.6 if/else Selection Structure 4.7.
PHP using MySQL Database for Web Development (part II)
Chapter 9 Repetition.
Chapter 4 – C Program Control
- Standard C Statements
JavaScript: Control Statements I
Chapter 8 - JavaScript: Control Statements I
CSC113: Computer Programming (Theory = 03, Lab = 01)
CiS 260: App Dev I Chapter 4: Control Structures II.
Lecturer CS & IT Department UOS MBDIN
Chapter 4 – Control Structures Part 1
JavaScript: Control Statements.
JavaScript: Control Statements I
Chapter 5 Repetition.
Loop Control Structure.
The University of Texas Rio Grande Valley
The University of Texas – Pan American
Structured Program
Chapter 3 - Structured Program Development
3 Control Statements:.
Chapter 6 Control Statements: Part 2
Chapter 3 - Structured Program Development
2.6 The if/else Selection Structure
JavaScript: Control Statements II
Control Statements Paritosh Srivastava.
Chapter 4 - Program Control
PROGRAM FLOWCHART Iteration Statements.
Dale Roberts, Lecturer IUPUI
Structural Program Development: If, If-Else
Presentation transcript:

1 Chap 4. Data Should know Declare & Initialize variables Declare constants Assignment Operators Increment and Decrement Operators Precedence of Operators Escape characters More on type casting/conversion in examples coming up AND READ Fig 6.19 and Section 5.11!

2 Chap 5-6. Control Structures Program of control Sequential execution Selection structure The if and if/else statements Switch statement The goto statement Repetition structures The while and do/while loops (chapter 5) The for and foreach loops (chapter 6, 8) Powerpoint slides modified from Deitel & Deitel

3 Conditional Operator (?:) C#’s only ternary operator Similar to an if/else structure The syntax is: (boolean value ? if true : if false) Example: Console.WriteLine (grade >= 60 ? “Passed” : “Failed”);

4 Indentation Visual Studio can indent control structures properly for you. Highlight relevant code Press Ctrl-K, Ctrl-F

// do-while repetition // initialization of loop counter counter= 1; // do 10 times do { // output counter Console.Write (counter); ++counter; } while ( counter <= 10 ) ; Console.WriteLine ( ); Blank line Program Output