Sequential Structures

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

Introduction to Macromedia Director 8.5 – Lingo
Sequential Logic Circuits. Set-Reset Latch The Set-Reset latch or bistable is a simple sequential logic circuit that remembers what has happened to the.
Computer Science 101 While Statement. Iteration: The While-Statement The syntax for the While- Statement is while : The syntax for the While- Statement.
CS107 Introduction to Computer Science Lecture 3, 4 An Introduction to Algorithms: Loops.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /15/2013 Lecture 11: MIPS-Conditional Instructions Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER.
Looping while … do …. Condition Process 2 Process 1 Y Repeated Loop.
ABNIAC The following slide presentation is to acquaint the student with ABNIAC. The version used for presentation is the Java version, which can be found.
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
1 9/28/07CS150 Introduction to Computer Science 1 Loops section 5.2, 5.4, 5.7.
1 10/20/08CS150 Introduction to Computer Science 1 do/while and Nested Loops Section 5.5 & 5.11.
CS150 Introduction to Computer Science 1
1 10/9/06CS150 Introduction to Computer Science 1 for Loops.
Basic Building Blocks of Programming. Variables and Assignment Think of a variable as an empty container Assignment symbol (=) means putting a value into.
1 10/25/06CS150 Introduction to Computer Science 1 Reading from and Writing to Files.
Sentinel Logic Assumes while loops and input statements.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#6)
V Avon High School Tech Club Agenda Old Business –Delete Files New Business –Week 16 Topics: Intro to HTML/CSS –Questions? Tech Club Forums.
An Introduction to Textual Programming
CSCI N201: Programming Concepts Copyright ©2005  Department of Computer & Information Science Using Decision Structures.
Outlines Chapter 3 –Chapter 3 – Loops & Revision –Loops while do … while – revision 1.
Programmer's view on Computer Architecture by Istvan Haller.
Chapter 2 - Algorithms and Design
Java Programming Constructs 3 MIS 3023 Business Programming Concepts II The University of Tulsa Professor: Akhilesh Bajaj All slides in this presentation.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
1 CSCI N201 Programming Concepts and Database 9 – Loops Lingma Acheson Department of Computer and Information Science, IUPUI.
Control Structures CPS120: Introduction to Computer Science Lecture 5.
CSCI-100 Introduction to Computing
Intro to Nested Looping Intro to Computer Science CS1510 Dr. Sarah Diesburg.
Introduction to Computing Concepts Note Set 15. JOptionPane.showMessageDialog Message Dialog Allows you to give a brief message to the user Can be used.
1 CS161 Introduction to Computer Science Topic #8.
11/10/2016CS150 Introduction to Computer Science 1 Last Time  We covered “for” loops.
Programming and Languages Dept. of Computer and Information Science IUPUI.
Using variable Variables are used to store values.
EGR 115 Introduction to Computing for Engineers Branching & Program Design – Part 3 Friday 03 Oct 2014 EGR 115 Introduction to Computing for Engineers.
Introduction to Computing Systems and Programming Programming.
TOPIC 8 MORE ON WHILE LOOPS 1 Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson,
Loops ( while and for ) CSE 1310 – Introduction to Computers and Programming Alexandra Stefan 1.
Python Loops and Iteration
C++ Programming: CS150 For.
Python: Control Structures
Chapter 3 Edited by JJ Shepherd
Think What will be the output?
Introduction to Programmng in Python
Chapter 6: Conditional Statements and Loops
Iterations Programming Condition Controlled Loops (WHILE Loop)
Control Structure Senior Lecturer
Chapter 4: Algorithm Design
Introduction to pseudocode
Repetition and Loops while do while for continue break
Unary Operators ++ and --
More Loops.
Digital Concepts for PLCs
For Loops.
CEV208 Computer Programming
More Looping Structures
Chapter 4: Algorithm Design
CSCI-N 100 Dept. of Computer and Information Science
Computer Science Core Concepts
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
Flowcharts and Pseudo Code
A LESSON IN LOOPING What is a loop?
CHAPTER 6: Control Flow Tools (for and while loops)
Using Decision Structures
Welcome back! October 11, 2018.
More Looping Structures
Types of loops definite loop: A loop that executes a known number of times. Examples: Repeat these statements 10 times. Repeat these statements k times.
Presentation transcript:

Sequential Structures Introduction to Programming Concepts Dept. of Computer and Information Science

Goals Understand why a sequence structure is used How to create sequence structure

Sequential Logic Early programs used sequential logic. That is, Step A happened before Step B. Step B happened before Step C, etc. Sequential programs are easy to write, but lack flexibility. (decisions and loops)

Sequential Structures A series of statements Executed in order No branching A jump in the flow of execution

Sequential Structures Start – where the program begins Input – data to be used for the program Step One, Step Two, etc. – the sequence of the program until it finishes No deviation

Sequential Statements Welcome Message Ask for data Input name, address, city, favorite color data Output data Write name, address, city, favorite color message

Sequential Structures var strUserName = ""; // user's name, this is a STRING var strUserCity = ""; // user's city, this is a STRING var intNumLetters = 0; // number of letters in user's first name, this is an INTEGER var strMessage = "" // output to the user, this is a STRING strUserName = window.prompt("What is your name?"); //this is asking for the user's name strUserCity = window.prompt("Where do you live?"); //this is asking what city does the user live in strMessage = ("Hello, "); strMessage += (strUserName.toUpperCase()); //this puts the user's name into uppercase letters strMessage += (". You live in "); strMessage += (strUserCity.toUpperCase()); //this puts the user's city into uppercase letters window.alert(strMessage); //this is the message given to the user intNumLetters = strUserName.length; // output to the user window.alert("There are " +intNumLetters+" letters in your first name."); //this is a string method, it is counting the number of letters in the user's name //this tells the user how many letters that user has in their name