LN #2 (3 Hrs) Variables, Sequence Boolean Logic & Selection CTPS Department of CSE,Coimbatore

Size: px
Start display at page:

Download "LN #2 (3 Hrs) Variables, Sequence Boolean Logic & Selection CTPS Department of CSE,Coimbatore"

Transcription

1 LN #2 (3 Hrs) Variables, Sequence Boolean Logic & Selection CTPS 2018

2 Objectives To understand variables and their values. To study the computational structure, form and functional elements for sequence & selection. To learn Boolean logic.

3 Variables A variable is like a box, a place holder, a memory location where is stored data in.

4 Let answer be a variable Get the value from user. Let us say the user types 2 The value 2 is stored in the variable answer

5 Access the value 2 stored in variable answer and do some processing if (answer is equal to 2) then print "You chose to go left " else print " a most dangerous path"

6 Variable x x

7 X = 0 X = X+1

8 X = 0 X = X+1

9 X = 0 X = X+1

10 X = 0 X = X+1

11 X = 0 X = X+1

12 Sequence Is a series of steps that take place one after another. 1. Enter the name 2. Enter mark1 3. Enter mark2 4. Enter mark3 5. Total = mark1+mark2+mark3 6. Average = Total / 3 7. Print Total, Average

13 Normally, statements in a program are executed sequentially, in the order that they were written.

14 Many solutions feature several choices or decisions. These decisions lead to different paths. These paths represent the result of making a choice.

15 Selection Is a decision Decisions may be answered as: Yes or No True or False Based on the answer ( Y/N or T/F) a path is chosen

16

17 Robots are dumb What does a robot need to know, to solve a maze? What commands and behaviors would be useful? R

18 R

19 R

20 THERE IS EMPTY SPACE R MOVE FORWARD

21 Conditionals

22 Boolean Value Anything that results in TRUE or FALSE can go into the if part of a conditional

23 Boolean Logic A way to figure out the truth of an expression using the simple concept oftrue or FALSE. Boolean logic means you are working with stuff that is eithertrue or FALSE.

24 Consider sunny_day. A day can either be sunny or not. so, sunny_day can be eithertrue or FALSE. sunny_day is a Boolean Variable that can have a Boolean Value(TRUE or FALSE). Now, say you want to go body surfing at the beach, but you don't want to go when it's cold or rainy, just when it is sunny. You can use Boolean logic

25 Boolean Expression IF (sunny_day) THEN go body surfing at the beach The Boolean expression sunny_day will have a truth value of TRUE or FALSE

26 Now let's say you don't swim so well. You need to have your water_wings on too. You now add water_wings to the conditional.

27 Boolean Expression IF (sunny_day) AND (water_wings) THEN go body surfing at the beach

28 Boolean Expression IF (sunny_day) AND (water_wings) THEN go body surfing at the beach The Boolean expression will have a truth value of TRUE or FALSE

29 Boolean Expression IF (sunny_day) AND (water_wings) THEN go body surfing at the beach If both of sunny_day and water_wings are TRUE, then the output (truth value) istrue ie, you head to the beach.. But if even one of these are FALSE, then the output (truth value) is FALSE ie,you stay home and dream of the beach

30 Operator AND Everything has to be TRUE true AND true = true true AND false AND true = false false AND false = false

31 Operator OR Only one thing has to be TRUE true OR true = true true OR false OR true = true false OR false = false

32 Expressions An expression is simply one or more variables and/or constants joined by operators An expression is evaluated and produces a result The result of all arithmetic expressions are either integers or reals An expression can also yield a result that is either true or false- BOOLEAN Such an expression is called a relational expression The result reflects how something "relates to something else. 32 Department of CSE

33 "Is the value of x greater than the value of y? Note that the preceding poses a question. Relational expressions are usually intended to answer yes/no, or true/false, questions. Obviously, boolean values and boolean variables play an important role in relational expressions. 33 Department of CSE

34 Operators To build relational expressions, two types of operators are used, relational operators and logical operators Relational operators Logical operators 34 Department of CSE

35 Expression Value of expression 3 < 4 True 7.6 <= 9 True 4 == 7 False 8.3!= 2.1 True Initial values a = 3 b=4 c=5 d=6 Expression a ==b c< d (a==b) && (c<d) (a==b) && (c<d) Value of expression False True False True result = (a==b) && (c<d)!result False true 35 Department of CSE

36 Truth assignment: TRUE or FALSE Let, (a < b (a >= b && c == d)) be statement 1 (a < b c == d) be statement 2 In the statements 1 and 2: a < b, c == d, a >= b are conditions to be checked fortrue or FALSE to determine the truth value of the entire expression

37 Logical expression (a < b (a >= b && c == d)) statement 1 (a < b c == d).. statement 2 # A. Let, a is less than b be True We inspect the first of the two conditions (a < b) to see if it is true It is true in both statements 1 and 2 TRUE is returned by both the statements

38 # B. Let, a is less than b be FALSE In statement 1 : We inspect the second of the two conditions (a >= b && c == d) to see if it is true We are asking whether both a >= b AND c == d are true If a < b is false, then a >= b is of course true

39 Therefore whether true or false is returned entirely depends on the condition : c == d If c == d is true then true is returned [ as a < b is false, a >= b is true ] the statement 1 returns true If c == d is false and false is returned [ as a < b is false, a >= b is true ] the statement 1 returns false

40 In statement 2 : We inspect the second of the two conditions c == d If c == d is true then true is returned a < b is false, the statement 2 returns true If c == d is false and false is returned as a < b is false, the statement 2 returns false

41 Evaluate the Boolean expressions 1. (T AND (NOT F) OR (T AND (NOT F))) 2. ((NOT F) OR (F AND (NOT T)) AND F)

42 Can you say how many choices are available for selection?

43 Multiple Choices One Choice Two Choices Multiple Choices

44 Selection Statements Selection statement gives a program the ability to choose which instruction(s) to next execute based on conditions. Types 1-Way selection (if statement). 2-Way selection (if-else statement). Multi-Way selection (or n-way selection, switch/case).

45 Considerations What is the form and type of expression that controls the selection? How are clauses specified if at all? If nesting is allowed, how is it specified and implemented?

46 One-Way Selection The if structure is a one-way selection structure. When a control expression in an if statement is evaluated to be true, the statements associated with the structure are executed. IF condition ENDIF THEN actions Figure: Selection - One Way

47 IF (I have a fishing pole) ENDIF THEN I am going fishing IF (orderamount < 40 ) ENDIF THEN ShippingCost =10

48 Model the following using one-way selection structure: England will qualify for the quarter-finals with Portugal if they win or draw with Romania. If the shop has Croissants buy croissants and leave the shop. If you like salty food then add the amount of salt you prefer.

49 IF England wins/draws with Romania THEN They will qualify for quarter-finals with Portugal IF the shop has Chips THEN buy Chips IF you like salty food THEN add the amount of salt you prefer

50 Two-Way Selection The if/else structure is a two-way selection structure. If the control expression in the if statement evaluates to true, one block of statements is executed; otherwise (else), another block is executed. IF condition THEN if-true actions ELSE if- false actions ENDIF Figure: Selection - Two Way

51 IF (the sun is shining) THEN I will go fishing ELSE I will play computer games IF (orderamount < 40 ) THEN ShippingCost = 10 ELSE ShippingCost = 0 ENDIF

52 Model using Two-Way selection structure: If there is a fire outside the door then go to another exit. Otherwise, remove the flap covering the handle, turn the handle, pull the door into the plane and throw it out the doorway, as far away as possible.

53 IF there is a fire outside the door THEN Go to another exit. ELSE 1. Remove the flap covering the handle. 2. Turn the handle. 3. Pull the door into the plane 4. Throw it out the doorway, as far away as possible

54 Complex Conditionals

55

56 Selection from Multiple Choices 1 The problem of determining a students letter grade given the numerical grade.

57 Consider the requirements for computing shipping cost based on the information given in table(shipping Cost Policy)

58 IF (orderamount > 0 AND orderamount < 20 ) THEN ShippingCost = 10 ELSE IF (orderamount >= 20 AND orderamount < 40) THEN ShippingCost = 5 ELSE ShippingCost = 0 ENDIF ENDIF

59 Find the largest of the three numbers A,B and C IF ( A >B ) THEN IF ( A > C ) THEN print A is largest ELSE print Cis largest END IF ELSE IF ( B > C ) THEN print B is largest ELSE print C is largest END IF END IF

60 Model using Multi-Way selection structure: The phone systems giving you instructions in this form. The message will say something like this: 1. If you wish to buy a ticket then press If you wish to listen to some music then press If you wish to listen to recorded information then press If you wish to speak to an operator then press If you wish to exit press 5.

61 if ( you wish to buy a ticket ) then press 1 else if ( you wish to listen to some music ) then press 2 else if ( you wish to listen to recorded information ) then press 3 else if ( you wish to speak to the operator ) then press 4 else press 5.

62 Calculate the sales tax and total amount due for different tax codes. tax code 0: sales_tax = 0 tax code 1: sales_tax = purch_amt * 0.03 tax code 2: sales_tax = purch_amt * 0.05 tax code 3: sales_tax = purch_amt * 0.07

63 Model using appropriate selection structure: 1. IF the user has struck the Confirm Purchase button, THEN initiate billing procedures. 2. IF the camera sensor detects adequate exposure, THEN close the camera shutter. 3. IF a song has just finished playing, THEN begin playing the next song in the playlist.

64 4. Shop opening timings 5. Which selection structure is suitable for allowing the users to perform basic operations(add, sub, mul, div, modulo division)?...can you model it?

65 4. if the day is Monday then the opening hours are 8am-8pm. elseif the day is Tuesday then opening hours are 8am-12pm. elseif the day is Wednesday then opening hours are 8am-8pm. elseif the day is Thursday then opening hours are 8am-8pm. elseif the day is Friday then opening hours are 8am-8pm. elseif the day is Saturday then opening hours are 9am-5pm. else the day is Sunday and the opening hours are 10am-4pm.

66 Predict the output

67 What has been described? Variables and values Sequence and Selection Expressions & Operators Boolean logic IF construct Credits Programming Languages,2nd edition,tucker and Noonan Organization of Programming Languages-Cheng (Fall 2004) Computing Without Computers,A Gentle Introduction to Computer Programming,Data Structures and Algorithms,Version 0.15,Paul Curzon Google images

Programming Language. Control Structures: Selection (switch) Eng. Anis Nazer First Semester

Programming Language. Control Structures: Selection (switch) Eng. Anis Nazer First Semester Programming Language Control Structures: Selection (switch) Eng. Anis Nazer First Semester 2018-2019 Multiple selection choose one of two things if/else choose one from many things multiple selection using

More information

Boolean Data-Type. Boolean Data Type (false, true) i.e. 3/6/2018. The type bool is also described as being an integer: bool bflag; bflag = true;

Boolean Data-Type. Boolean Data Type (false, true) i.e. 3/6/2018. The type bool is also described as being an integer: bool bflag; bflag = true; Programming in C++ If Statements If the sun is shining Choice Statements if (the sun is shining) go to the beach; True Beach False Class go to class; End If 2 1 Boolean Data Type (false, ) i.e. bool bflag;

More information

How Do Robots Find Their Way?

How Do Robots Find Their Way? How Do Robots Find Their Way? Conditionals and Repetition http://en.wikipedia.org/wiki/file:cyclope_robot.jpg http://www.youtube.com/watch?v=_l9rklaskwu Learning Objectives Learn basic programming concepts

More information

Chapter 3, Selection. Liang, Introduction to Programming with C++, Second Edition, (c) 2010 Pearson Education, Inc. All rights reserved.

Chapter 3, Selection. Liang, Introduction to Programming with C++, Second Edition, (c) 2010 Pearson Education, Inc. All rights reserved. Chapter 3, Selection 1 The bool Type and Operators 2 One-way if Statements if (booleanexpression) { statement(s); } if (radius >= 0) { area = radius * radius * PI; cout

More information

Physics 2660: Fundamentals of Scientific Computing. Lecture 5 Instructor: Prof. Chris Neu

Physics 2660: Fundamentals of Scientific Computing. Lecture 5 Instructor: Prof. Chris Neu Physics 2660: Fundamentals of Scientific Computing Lecture 5 Instructor: Prof. Chris Neu (chris.neu@virginia.edu) Reminder I am back! HW04 due Thursday 22 Feb electronically by noon HW grades are coming.

More information

Grade 8 Common Mathematics Assessment Multiple Choice Answer Sheet Name: Mathematics Teacher: Homeroom: Section A No Calculator Permitted

Grade 8 Common Mathematics Assessment Multiple Choice Answer Sheet Name: Mathematics Teacher: Homeroom: Section A No Calculator Permitted Multiple Choice Answer Sheet Name: Mathematics Teacher: Homeroom: Section A No Calculator Permitted Calculator Permitted. A B C D 2. A B C D. A B C D 4. A B C D 5. A B C D 6. A B C D 7. A B C D 8. A B

More information

Relational & Logical Operators, if and switch Statements

Relational & Logical Operators, if and switch Statements 1 Relational & Logical Operators, if and switch Statements Topics Relational Operators and Expressions The if Statement The if- Statement Nesting of if- Statements switch Logical Operators and Expressions

More information

Armstrong State University Engineering Studies MATLAB Marina Switch-Case Statements Primer

Armstrong State University Engineering Studies MATLAB Marina Switch-Case Statements Primer Armstrong State University Engineering Studies MATLAB Marina Switch-Case Statements Primer Prerequisites The Switch-Case Statements Primer assumes knowledge of the MATLAB IDE, MATLAB help, arithmetic operations,

More information

Control Structures. Lecture 4 COP 3014 Fall September 18, 2017

Control Structures. Lecture 4 COP 3014 Fall September 18, 2017 Control Structures Lecture 4 COP 3014 Fall 2017 September 18, 2017 Control Flow Control flow refers to the specification of the order in which the individual statements, instructions or function calls

More information

Other conditional and loop constructs. Fundamentals of Computer Science Keith Vertanen

Other conditional and loop constructs. Fundamentals of Computer Science Keith Vertanen Other conditional and loop constructs Fundamentals of Computer Science Keith Vertanen Overview Current loop constructs: for, while, do-while New loop constructs Get out of loop early: break Skip rest of

More information

if Statement Numeric Rela5onal Operators The if Statement Flow of Control: Branching (Savitch, Chapter 3)

if Statement Numeric Rela5onal Operators The if Statement Flow of Control: Branching (Savitch, Chapter 3) if Statement Flow of Control: Branching (Savitch, Chapter 3) TOPICS Conditional Execution if and Statement Boolean Data switch Statement Ensures that a statement is executed only when some condi5on is

More information

BITG 1223: Selection Control Structure by: ZARITA (FTMK) LECTURE 4 (Sem 1, 16/17)

BITG 1223: Selection Control Structure by: ZARITA (FTMK) LECTURE 4 (Sem 1, 16/17) BITG 1223: Selection Control Structure by: ZARITA (FTMK) LECTURE 4 (Sem 1, 16/17) 1 Learning Outcomes At the end of this lecture, you should be able to: 1. Explain the concept of selection control structure

More information

if Statement Numeric Rela7onal Operators The if Statement Flow of Control: Branching (Savitch, Chapter 3)

if Statement Numeric Rela7onal Operators The if Statement Flow of Control: Branching (Savitch, Chapter 3) if Statement Flow of Control: Branching (Savitch, Chapter 3) TOPICS Conditional Execution if,, and if boolean data switch statements CS 160, Fall Semester 2015 1 Programs o-en contain statements that may

More information

Chapter 4: Making Decisions

Chapter 4: Making Decisions Chapter 4: Making Decisions CSE 142 - Computer Programming I 1 4.1 Relational Operators Relational Operators Used to compare numbers to determine relative order Operators: > Greater than < Less than >=

More information

Assessment - Unit 3 lessons 16-21

Assessment - Unit 3 lessons 16-21 Name(s) Period Date Assessment - Unit 3 lessons 16-21 1. Which of the following statements about strings in JavaScript is FALSE? a. Strings consist of a sequence of concatenated ASCII characters. b. Strings

More information

Logic & program control part 3: Compound selection structures

Logic & program control part 3: Compound selection structures Logic & program control part 3: Compound selection structures Multi-way selection Many algorithms involve several possible pathways to a solution A simple if/else structure provides two alternate paths;

More information

LN #3 (3 Hrs) Repetition, Computational state CTPS Department of CSE,Coimbatore

LN #3 (3 Hrs) Repetition, Computational state CTPS Department of CSE,Coimbatore LN #3 (3 Hrs) Repetition, Computational state CTPS 2018 Objectives To understand repetition of statements. To comprehend the form of test and termination in looping. To study the form and function of elements

More information

Microsoft Visual Basic 2005: Reloaded

Microsoft Visual Basic 2005: Reloaded Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 4 Making Decisions in a Program Objectives After studying this chapter, you should be able to: Include the selection structure in pseudocode

More information

TICKET PRE-SALE INFORMATION

TICKET PRE-SALE INFORMATION TICKET PRE-SALE INFORMATION I WANT TO GET FIRST ACCESS TO TICKETS FOR HARRY STYLES UK AUTUMN 2017 DATES, HOW DO I DO THIS? You need to have pre-ordered Harry Styles brand new self-titled album (available

More information

Selection Statements

Selection Statements Selection Statements by Ahmet Sacan selection statements, branching statements, condition, relational expression, Boolean expression, logical expression, relational operators, logical operators, truth

More information

CS150 Introduction to Computer Science 1. Logical Operators and if/else statement

CS150 Introduction to Computer Science 1. Logical Operators and if/else statement 1 Logical Operators and if/else statement 2 If Statement We may want to execute some code if an expression is true, and execute some other code when the expression is false. This can be done with two if

More information

CHAPTER : 9 FLOW OF CONTROL

CHAPTER : 9 FLOW OF CONTROL CHAPTER 9 FLOW OF CONTROL Statements-Statements are the instructions given to the Computer to perform any kind of action. Null Statement-A null statement is useful in those case where syntax of the language

More information

Private Swimming Lessons

Private Swimming Lessons Private Swimming Lessons Private Lessons Designed for participants who would like a 1:1 ratio. Participants will receive individual attention to improve their swimming technique and have the convenience

More information

SELECTION. (Chapter 2)

SELECTION. (Chapter 2) SELECTION (Chapter 2) Selection Very often you will want your programs to make choices among different groups of instructions For example, a program processing requests for airline tickets could have the

More information

Using Variables to Write Pattern Rules

Using Variables to Write Pattern Rules Using Variables to Write Pattern Rules Goal Use numbers and variables to represent mathematical relationships. 1. a) What stays the same and what changes in the pattern below? b) Describe the pattern rule

More information

Computational Expression

Computational Expression Computational Expression Conditionals Janyl Jumadinova 10 October, 2018 Janyl Jumadinova Computational Expression 10 October, 2018 1 / 16 Computational Thinking: a problem solving process Decomposition

More information

Chapter 4: Making Decisions. Copyright 2012 Pearson Education, Inc. Sunday, September 7, 14

Chapter 4: Making Decisions. Copyright 2012 Pearson Education, Inc. Sunday, September 7, 14 Chapter 4: Making Decisions 4.1 Relational Operators Relational Operators Used to compare numbers to determine relative order Operators: > Greater than < Less than >= Greater than or equal to

More information

Objectives/Outcomes. Introduction: If we have a set "collection" of fruits : Banana, Apple and Grapes.

Objectives/Outcomes. Introduction: If we have a set collection of fruits : Banana, Apple and Grapes. 1 September 26 September One: Sets Introduction to Sets Define a set Introduction: If we have a set "collection" of fruits : Banana, Apple Grapes. 4 F={,, } Banana is member "an element" of the set F.

More information

Chapter 3. Iteration

Chapter 3. Iteration Chapter 3 Iteration Iteration Iteration is the form of program control that allows us to repeat a section of code. For this reason this form of control is often also referred to as repetition. The programming

More information

Decision Structures. Chapter 4

Decision Structures. Chapter 4 Decision Structures Chapter 4 Chapter 4 Objectives To understand: o What values can be stored in a Boolean variable o What sequence structures are and when used o What decision structures are and when

More information

Math 55 - Spring 04 - Lecture notes # 1 - Jan 20 (Tuesday)

Math 55 - Spring 04 - Lecture notes # 1 - Jan 20 (Tuesday) Math 55 - Spring 04 - Lecture notes # 1 - Jan 20 (Tuesday) Name, class, URL (www.cs.berkeley.edu/~demmel/ma55) on board Head TA Mike West speaks on bureaucracy Advertise CS 70 (T Th 2-3:30) as an "honors"

More information

CS Introduction to Programming Fall 2016

CS Introduction to Programming Fall 2016 CS 1113-300 Introduction to Programming Fall 2016 Exam 3 Review - Part 2 (Python) Friday, December 2 nd, 2016 Ahmed Ibrahim 1 / 26 Course Evaluation Please take a few minutes to submit your course evaluation

More information

Physics 1P21/1P91. Software Registration. 1. Sapling Learning 2. FlipIt Physics 3. REEF Polling

Physics 1P21/1P91. Software Registration. 1. Sapling Learning 2. FlipIt Physics 3. REEF Polling Physics 1P21/1P91 Software Registration 1. Sapling Learning 2. FlipIt Physics 3. REEF Polling Physics 1P21/1P91 Software Registration 1. SAPLING LEARNING Registration Instructions What is Sapling Learning?

More information

npm run pull npm start

npm run pull npm start 1. Open Visual Studio Code 2. At the top click on View->Integrated Terminal (if not already open) 3. In the terminal, first run: npm run pull 4. After this finishes run: npm start Logical Operators Lecture

More information

Repetition Structures

Repetition Structures Repetition Structures Chapter 5 Fall 2016, CSUS Introduction to Repetition Structures Chapter 5.1 1 Introduction to Repetition Structures A repetition structure causes a statement or set of statements

More information

Chapter 4: Making Decisions

Chapter 4: Making Decisions Chapter 4: Making Decisions 4.1 Relational Operators Relational Operators Used to compare numbers to determine relative order Operators: > Greater than < Less than >= Greater than or equal to

More information

CS1150 Principles of Computer Science Boolean, Selection Statements

CS1150 Principles of Computer Science Boolean, Selection Statements CS1150 Principles of Computer Science Boolean, Selection Statements Yanyan Zhuang Department of Computer Science http://www.cs.uccs.edu/~yzhuang CS1150 Math Center https://www.uccs.edu/mathcenter/schedules

More information

Functional Mathematics 4368

Functional Mathematics 4368 Centre Number Surname Candidate Number For Examiner s Use Other Names Candidate Signature Examiner s Initials Question Mark Functional Skills Certificate June 2015 Functional Mathematics 4368 Level 2 1

More information

Pseudocode. ARITHMETIC OPERATORS: In pseudocode arithmetic operators are used to perform arithmetic operations. These operators are listed below:

Pseudocode. ARITHMETIC OPERATORS: In pseudocode arithmetic operators are used to perform arithmetic operations. These operators are listed below: Pseudocode There are 3 programming/pseudocode constructs: 1. Sequence: It refers that instructions should be executed one after another. 2. Selection: This construct is used to make a decision in choosing

More information

4.1. Chapter 4: Simple Program Scheme. Simple Program Scheme. Relational Operators. So far our programs follow a simple scheme

4.1. Chapter 4: Simple Program Scheme. Simple Program Scheme. Relational Operators. So far our programs follow a simple scheme Chapter 4: 4.1 Making Decisions Relational Operators Simple Program Scheme Simple Program Scheme So far our programs follow a simple scheme Gather input from the user Perform one or more calculations Display

More information

Selections. CSE 114, Computer Science 1 Stony Brook University

Selections. CSE 114, Computer Science 1 Stony Brook University Selections CSE 114, Computer Science 1 Stony Brook University http://www.cs.stonybrook.edu/~cse114 1 Motivation If you assigned a negative value for radius in ComputeArea.java, then you don't want the

More information

1. Logging into My Media Mall

1. Logging into My Media Mall 1 For Nook Classic and Touch Instructions for Borrowing Nook E-books from My Media Mall *You will need to download software in order to get e-books from My Media Mall for the Nook. Nook books cannot be

More information

Programming Logic and Design Sixth Edition

Programming Logic and Design Sixth Edition Objectives Programming Logic and Design Sixth Edition Chapter 4 Making Decisions In this chapter, you will learn about: Evaluating Boolean expressions to make comparisons The relational comparison operators

More information

CS61A Lecture 9 Immutable Data Structures. Jom Magrotker UC Berkeley EECS July 2, 2012

CS61A Lecture 9 Immutable Data Structures. Jom Magrotker UC Berkeley EECS July 2, 2012 CS61A Lecture 9 Immutable Data Structures Jom Magrotker UC Berkeley EECS July 2, 2012 COMPUTER SCIENCE IN THE NEWS Google unveils Glass at Google I/O, June 27 Prototypes available to developers at the

More information

CSE115 / CSE503 Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall Office hours:

CSE115 / CSE503 Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall Office hours: CSE115 / CSE503 Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall alphonce@buffalo.edu Office hours: Tuesday 10:00 AM 12:00 PM * Wednesday 4:00 PM 5:00 PM Friday 11:00 AM 12:00 PM OR

More information

CSCE 206: Structured Programming in C++

CSCE 206: Structured Programming in C++ CSCE 206: Structured Programming in C++ 2017 Spring Exam 2 Monday, March 20, 2017 Total - 100 Points B Instructions: Total of 13 pages, including this cover and the last page. Before starting the exam,

More information

CHAPTER 5 FLOW OF CONTROL

CHAPTER 5 FLOW OF CONTROL CHAPTER 5 FLOW OF CONTROL PROGRAMMING CONSTRUCTS - In a program, statements may be executed sequentially, selectively or iteratively. - Every programming language provides constructs to support sequence,

More information

ChipRider AQA GCSE Computer Science Mobile Assignment

ChipRider AQA GCSE Computer Science Mobile Assignment ChipRider AQA GCSE Computer Science Mobile Assignment 1. Design of solution 2. Solution Development 3. Programming Techniques Used 4. Testing and Evaluation 1 Design of Solution What the problem involves

More information

Connect to CCPL

Connect to CCPL Connect to Tech @ CCPL Charleston County Public Library TECH NEWS January February March 2016 Send your request in an email to techteam@ccpl.org with your full name and phone number. We ll add you to the

More information

ibutton Solo Setup Instructions

ibutton Solo Setup Instructions ibutton Solo Setup Instructions TimePilot Corporation, Batavia, Illinois 60510 www.crossoverlock.com TimePilot Corp., all rights reserved. Part No. 80022160 TimePilot ibutton Solo Lock Manual Introduction

More information

CSE115 / CSE503 Introduction to Computer Science I. Dr. Carl Alphonce 343 Davis Hall Office hours:

CSE115 / CSE503 Introduction to Computer Science I. Dr. Carl Alphonce 343 Davis Hall Office hours: CSE115 / CSE503 Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall alphonce@buffalo.edu Office hours: Thursday 12:00 PM 2:00 PM Friday 8:30 AM 10:30 AM OR request appointment via e-mail

More information

Understanding the problem

Understanding the problem 2.1.1 Problem solving and design An algorithm is a plan, a logical step-by-step process for solving a problem. Algorithms are normally written as a flowchart or in pseudocode. The key to any problem-solving

More information

Rock-Paper-Scissors Multiple versions Nested If / Else If / Else Random Numbers

Rock-Paper-Scissors Multiple versions Nested If / Else If / Else Random Numbers VISUAL BASIC Rock-Paper-Scissors Multiple versions Nested If / Else If / Else Random Numbers Copyright 2015 Dan McElroy Topics Covered OProject Definition OMultiple versions of the program ODetermine the

More information

Logical Operators and if/else statement. If Statement. If/Else (4.3)

Logical Operators and if/else statement. If Statement. If/Else (4.3) Logical Operators and if/ statement 1 If Statement We may want to execute some code if an expression is true, and execute some other code when the expression is false. This can be done with two if statements

More information

THEHOMEPAGE. Vero Beach Computer Group. In this Issue... VOLUME 28, ISSUE 3-4 MARCH/APRIL

THEHOMEPAGE. Vero Beach Computer Group. In this Issue... VOLUME 28, ISSUE 3-4 MARCH/APRIL Vero Beach Computer Group THEHOMEPAGE VOLUME 28, ISSUE 3-4 MARCH/APRIL. 2010 www.vbcg.org In this Issue... General Meeting Info 1 Microsoft Windows Phone 7 2 The Mac Corner 3 HELP LIBRARY 4 SIG 2010 Schedule

More information

Officials Support Center

Officials Support Center Officials Support Center Officials General Help Monday, July 19, 2010 ArbiterSports Officials Online Help How do I set my availability? How do I view my schedule? How do I accept/decline games on my schedule?

More information

boolean & if-then-else

boolean & if-then-else boolean & if-then-else Lecture 03 Step 1: Open VSCode and its Integrated Terminal Step 2: npm run pull Step 3: npm run start Step 4: Open another tab to pollev.com/comp110 Assignments Out Problem Set 0

More information

STUDENT FAQS (LAUNCHPAD, WRITER'S HELP 2.0, AND LEARNINGCURVE)

STUDENT FAQS (LAUNCHPAD, WRITER'S HELP 2.0, AND LEARNINGCURVE) STUDENT FAQS (LAUNCHPAD, WRITER'S HELP 2.0, AND LEARNINGCURVE) Table of Contents... 3 What are the minimum system requirements for your media?... 4 Access Code FAQs... 6 How do I register for my course

More information

COP 1220 Introduction to Programming in C++ Course Justification

COP 1220 Introduction to Programming in C++ Course Justification Course Justification This course is a required first programming C++ course in the following degrees: Associate of Arts in Computer Science, Associate in Science: Computer Programming and Analysis; Game

More information

Personal Banking Upgrade 2.MO Guide

Personal Banking Upgrade 2.MO Guide Personal Banking Upgrade 2.MO Guide Everything You Need to Know About our Upcoming Enhancements What s Inside? Key dates when systems will be unavailable Instructions for logging into Online Banking after

More information

Geometry Lesson 2.1 Conditional Statements. September 4, 2007

Geometry Lesson 2.1 Conditional Statements. September 4, 2007 Geometry Lesson 2.1 Conditional Statements September 4, 2007 Objectives Students will be able to: Define: conditional statement, hypothesis, conclusion, converse, inverse, contrapositive, equivalent statements

More information

Go to drive.google.com. Google Drive. Select Create an account

Go to drive.google.com. Google Drive. Select Create an account Google Drive Google Docs Google Drive is the new home for Google Docs Create and share your work online and access your documents from anywhere Manage documents, spreadsheets, presentations, surveys, and

More information

5. Selection: If and Switch Controls

5. Selection: If and Switch Controls Computer Science I CS 135 5. Selection: If and Switch Controls René Doursat Department of Computer Science & Engineering University of Nevada, Reno Fall 2005 Computer Science I CS 135 0. Course Presentation

More information

PA3: Violet's Vending Venture (Version 3.0)

PA3: Violet's Vending Venture (Version 3.0) CS 159: Programming Fundamentals James Madison University, Spring 2017 Semester PA3: Violet's Vending Venture (Version 3.0) Due Dates PA3-A: Wednesday, Feb. 22 at 11:00 pm PA3-A is a Canvas online readiness

More information

Chapter 4 Lab. Loops and Files. Objectives. Introduction

Chapter 4 Lab. Loops and Files. Objectives. Introduction Chapter 4 Lab Loops and Files Objectives Be able to convert an algorithm using control structures into Java Be able to write a while loop Be able to write a do-while loop Be able to write a for loop Be

More information

Outline. Announcements. Homework 2. Boolean expressions 10/12/2007. Announcements Homework 2 questions. Boolean expression

Outline. Announcements. Homework 2. Boolean expressions 10/12/2007. Announcements Homework 2 questions. Boolean expression Outline ECS 10 10/8 Announcements Homework 2 questions Boolean expressions If/else statements State variables and avoiding sys.exit( ) Example: Coin flipping (if time permits) Announcements Professor Amenta

More information

Fridays, Saturdays, and Sundays March 2 May 6 (none on Easter, April 1) Saturday times are 9 12:50 p.m., 1 4:50 p.m., 5 9 p.m.

Fridays, Saturdays, and Sundays March 2 May 6 (none on Easter, April 1) Saturday times are 9 12:50 p.m., 1 4:50 p.m., 5 9 p.m. Dick s Sporting Goods, Tom Thumb/Albertsons, and Lowe s Sign-ups Dick s Sporting Goods Dates and Times: Fridays, Saturdays, and Sundays March 2 May 6 (none on Easter, April 1) Friday times are 4 8 p.m.

More information

Practice Midterm Exam Solutions

Practice Midterm Exam Solutions CS 470/670 Introduction to AI Spring 2016 Instructor: Marc Pomplun Practice Midterm Exam Solutions Duration: 75 minutes Question 1: out of points Question 2: out of points Question 3: out of points Question

More information

CS 302 ALGORITHMS AND DATA STRUCTURES

CS 302 ALGORITHMS AND DATA STRUCTURES CS 302 ALGORITHMS AND DATA STRUCTURES A famous quote: Program = Algorithm + Data Structure General Problem You have some data to be manipulated by an algorithm E.g., list of students in a school Each student

More information

Frequently Asked Questions ORDERING ON MYHERBALIFE.COM INDIA, January 2013

Frequently Asked Questions ORDERING ON MYHERBALIFE.COM INDIA, January 2013 Click on any of the section headers below to jump to the answers for the questions in that section. If you cannot find the answer to your question, please contact Associate Services at 080-40311444, 10

More information

Nights & Weekend ROB & PHIL DECEMBER 12, 2008

Nights & Weekend ROB & PHIL DECEMBER 12, 2008 Nights & Weekend ROB & PHIL DECEMBER 12, 2008 Input Surveys R&IS Student Assistant R&IS Faculty & Staff Access Services Students Statistics Totals Services R&IS & Access Service Seniority R&IS Student

More information

Baked Potato Bar, 1:00 Cost: $2. You can purchase a potato after everyone on the list has her potato

Baked Potato Bar, 1:00 Cost: $2. You can purchase a potato after everyone on the list has her potato Women's Club News March 29, 2019 View this email in your browser. THIS WEEK Monday, April 1 Food Drive, April 1-15 Please donate nonperishable food items for the Salvation Army Food Pantry. Click on the

More information

Orange Coast College BUSINESS & COMPUTING DIVISION EVENING, WEEKEND & ONLINE COURSES. that fit your schedule and goals!

Orange Coast College BUSINESS & COMPUTING DIVISION EVENING, WEEKEND & ONLINE COURSES. that fit your schedule and goals! Orange Coast College BUSINESS & COMPUTING DIVISION EVENING, WEEKEND & ONLINE COURSES that fit your schedule and goals! FALL 2018 term begins August 27, 2018 8 and 16 week courses are available ACCOUNTING

More information

Introduction to Computing Lecture 05: Selection (continued)

Introduction to Computing Lecture 05: Selection (continued) Introduction to Computing Lecture 05: Selection (continued) Assist.Prof.Dr. Nükhet ÖZBEK Ege University Department of Electrical & Electronics Engineering nukhet.ozbek@ege.edu.tr Topics Type int as Boolean

More information

plot those points on a graph. 5.Evaluate the equation y = 225 x 2 at the points x={ 15, 12, 9, 0, 9, 12, 15}. Then

plot those points on a graph. 5.Evaluate the equation y = 225 x 2 at the points x={ 15, 12, 9, 0, 9, 12, 15}. Then Construct a Concept Lesson Goal: Students are able to construct a concept for a working definition of What is a function? in terms of input and output by evaluating and comparing graphs of example functions

More information

Math 202 Test Problem Solving, Sets, and Whole Numbers 19 September, 2008

Math 202 Test Problem Solving, Sets, and Whole Numbers 19 September, 2008 Math 202 Test Problem Solving, Sets, and Whole Numbers 19 September, 2008 Ten questions, each worth the same amount. Complete six of your choice. I will only grade the first six I see. Make sure your name

More information

TO DO LIST FOR THE 2018 CHORUS PHOTO CHAIRMAN

TO DO LIST FOR THE 2018 CHORUS PHOTO CHAIRMAN TO DO LIST FOR THE 2018 CHORUS PHOTO CHAIRMAN The Regional team will be emailing you the necessary forms before the competition. If you don t get any, please email us at erlphoto@comcast.net and tell us

More information

Problem Solving with Decisions. T.Fatin Alhila

Problem Solving with Decisions. T.Fatin Alhila Problem Solving with Decisions 1 Decision Logic Structure - The decision structure is one of the most powerful structures because it is the only way that the computer can choose between two or more sets

More information

Algoritma dan Struktur Data Leon Andretti Abdillah. 08 Control Flow Statements Selection by Using Switch and Case

Algoritma dan Struktur Data Leon Andretti Abdillah. 08 Control Flow Statements Selection by Using Switch and Case Algoritma dan Struktur Data Leon Andretti Abdillah 08 Control Flow Statements Selection by Using Switch and Case Introduction The if statement allows you to select one of two sections of code to execute

More information

Lecture 1. Course Overview, Python Basics

Lecture 1. Course Overview, Python Basics Lecture 1 Course Overview, Python Basics We Are Very Full! Lectures are at fire-code capacity. We cannot add sections or seats to lectures You may have to wait until someone drops No auditors are allowed

More information

LECTURE 04 MAKING DECISIONS

LECTURE 04 MAKING DECISIONS PowerPoint Slides adapted from *Starting Out with C++: From Control Structures through Objects, 7/E* by *Tony Gaddis* Copyright 2012 Pearson Education Inc. COMPUTER PROGRAMMING LECTURE 04 MAKING DECISIONS

More information

LAB 5: SELECTION STATEMENTS

LAB 5: SELECTION STATEMENTS Statement Purpose: The purpose of this lab is to familiarize students with Conditional statements and explain how to control the sequence of statement execution, depending on the value of an expression

More information

Michele Van Dyne Museum 204B CSCI 136: Fundamentals of Computer Science II, Spring

Michele Van Dyne Museum 204B  CSCI 136: Fundamentals of Computer Science II, Spring Michele Van Dyne Museum 204B mvandyne@mtech.edu http://katie.mtech.edu/classes/csci136 CSCI 136: Fundamentals of Computer Science II, Spring 2016 1 Review of Java Basics Data Types Arrays NEW: multidimensional

More information

Introduction to the MBTA Online Corporate Pass Program

Introduction to the MBTA Online Corporate Pass Program Introduction to the MBTA Online Corporate Pass Program CharlieCard Corporate Service 1-888-844-0353 corporateprogram@mbta.com Monday through Friday 7AM to 8PM EST Saturday and Sunday 9AM to 5PM EST Introduction

More information

D365 Icons and Tooltips USER GUIDE

D365 Icons and Tooltips USER GUIDE D365 Icons and Tooltips USER GUIDE July 2018 Version 1.0.0 Table of Contents 1 Introduction... 4 1.1... Problems... 4 1.2... D365 Icons and Tooltips solution... 4 2 Supported versions, Install and Un-install...

More information

61A Lecture 3. Friday, September 5

61A Lecture 3. Friday, September 5 61A Lecture 3 Friday, September 5 Announcements There's plenty of room in live lecture if you want to come (but videos are still better) Please don't make noise outside of the previous lecture! Homework

More information

Condition-Controlled Loop. Condition-Controlled Loop. If Statement. Various Forms. Conditional-Controlled Loop. Loop Caution.

Condition-Controlled Loop. Condition-Controlled Loop. If Statement. Various Forms. Conditional-Controlled Loop. Loop Caution. Repetition Structures Introduction to Repetition Structures Chapter 5 Spring 2016, CSUS Chapter 5.1 Introduction to Repetition Structures The Problems with Duplicate Code A repetition structure causes

More information

Personal Online Banking External Transfers

Personal Online Banking External Transfers Personal Online Banking External Transfers Quick Reference Guide www.solvaybank.com 315-484-2201 General Questions about External Transfers Q. Do I have to be enrolled in Bill Pay before I can use External

More information

61A LECTURE 1 FUNCTIONS, VALUES. Steven Tang and Eric Tzeng June 24, 2013

61A LECTURE 1 FUNCTIONS, VALUES. Steven Tang and Eric Tzeng June 24, 2013 61A LECTURE 1 FUNCTIONS, VALUES Steven Tang and Eric Tzeng June 24, 2013 Welcome to CS61A! The Course Staff - Lecturers Steven Tang Graduated L&S CS from Cal Back for a PhD in Education Eric Tzeng Graduated

More information

Year 10 Semester 1 Assessment Calendar

Year 10 Semester 1 Assessment Calendar Weeks Date Subject Class Task Periods Term 1 Wk 2 Monday 2 February Tuesday 3 February SWIMMING CARNIVAL Wednesday 4 February Thursday 5 February Friday 6 February ENRICHMENT CAMP 7 & 8 Term 1 Wk 3 Monday

More information

1/15 2/19 3/23 4/28 5/12 6/23 Total/120 % Please do not write in the spaces above.

1/15 2/19 3/23 4/28 5/12 6/23 Total/120 % Please do not write in the spaces above. 1/15 2/19 3/23 4/28 5/12 6/23 Total/120 % Please do not write in the spaces above. Directions: You have 50 minutes in which to complete this exam. Please make sure that you read through this entire exam

More information

Computers and FORTRAN Language Fortran 95/2003. Dr. Isaac Gang Tuesday March 1, 2011 Lecture 3 notes. Topics:

Computers and FORTRAN Language Fortran 95/2003. Dr. Isaac Gang Tuesday March 1, 2011 Lecture 3 notes. Topics: Computers and FORTRAN Language Fortran 95/2003 Dr. Isaac Gang Tuesday March 1, 2011 Lecture 3 notes Topics: - Program Design - Logical Operators - Logical Variables - Control Statements Any FORTRAN program

More information

AP Computer Science Principles Exam Reference Sheet

AP Computer Science Principles Exam Reference Sheet AP Computer Science Principles Exam Reference Sheet July 2015 As AP Computer Science Principles does not designate any particular programming language, this reference sheet provides instructions and explanations

More information

Introduction to Programming

Introduction to Programming Introduction to Programming session 6 Instructor: Reza Entezari-Maleki Email: entezari@ce.sharif.edu 1 Spring 2011 These slides are created using Deitel s slides Sharif University of Technology Outlines

More information

DATA TYPES. Numeric Data

DATA TYPES. Numeric Data Numeric Data Numeric data simply means numbers. But, numbers come in a variety of different types... Integers An integer is a whole number - it has no decimal or fractional parts. Integers can be either

More information

IMPORTANT WORDS TO KNOW UNIT 1

IMPORTANT WORDS TO KNOW UNIT 1 IMPORTANT WORDS TO KNOW UNIT READ THESE WORDS ALOUD THREE TIMES WITH YOUR TEACHER! Chapter. equation. integer 3. greater than 4. positive 5. negative 6. operation 7. solution 8. variable Chapter. ordered

More information

Doubletwist won 39 t sync all music

Doubletwist won 39 t sync all music Doubletwist won 39 t sync all music posted 2013-Dec-8, 9:39 pm HTC Sync Manager connects but wont allow me to copy files, it does nothing. So I can open the Music folder (Like on a PC) and drop my music

More information

REFERENCE MATERIALS. Assignment, Display, and Input Evaluates expression and assigns the result to the variable a.

REFERENCE MATERIALS. Assignment, Display, and Input Evaluates expression and assigns the result to the variable a. a expression Assignment, Display, and Input Evaluates expression and assigns the result to the variable a. DISPLAY (expression) Displays the value of expression, followed by a space. INPUT () Accepts a

More information

Instructions for Filling Out The Indiana 811 Membership Agreement

Instructions for Filling Out The Indiana 811 Membership Agreement Instructions for Filling Out The Indiana 811 Membership Agreement 1. There are two (2) copies of the membership agreement. Please fill out both copies and return them to Indiana 811. Once you are on-line

More information

Practice Midterm Examination #1

Practice Midterm Examination #1 Eric Roberts Handout #35 CS106A May 2, 2012 Practice Midterm Examination #1 Review session: Sunday, May 6, 7:00 9:00 P.M., Hewlett 200 Midterm exams: Tuesday, May 8, 9:00 11:00 A.M., CEMEX Auditorium Tuesday,

More information