Random Functions Selection Structure Comparison Operators Logical Operator 10 20 30 40 50 40 30 20 10 50 40 30 20 10 50 40 30 20 10 50 40 30 20 10.

Slides:



Advertisements
Similar presentations
Decision Structures - If / Else If / Else. Decisions Often we need to make decisions based on information that we receive. Often we need to make decisions.
Advertisements

1.
An Introduction to Programming with C++ Fifth Edition Chapter 5 The Selection Structure.
Slides prepared by Rose Williams, Binghamton University Chapter 3 Flow of Control if-else and switch statements.
Comparing Numeric Values If Val(Text1.Text) = MaxPrice Then (Is the current numeric value stored in the Text property of Text1 equal to the value stored.
Primitive Types Java supports two kinds of types of values – objects, and – values of primitive data types variables store – either references to objects.
JavaScript, Fourth Edition
JavaScript, Third Edition
C++ for Engineers and Scientists Third Edition
Introduction to programming Language C, Data Types, Variables, Constants. Basics of C –Every program consists of one or more functions and must have main.
CSci 125 Lecture 10 Martin van Bommel. Simple Statements Expression followed by semicolon Assignments total = n1 + n2; Function calls printf(”Hello.\n”);
Microsoft Visual Basic 2008: Reloaded Fourth Edition
Chapter 4: The Selection Structure
Using the selection structure (Unit 7) Visual Basic for Applications.
Chapter 4: The Selection Structure
1 Chapter 4: Selection Structures. In this chapter, you will learn about: – Selection criteria – The if-else statement – Nested if statements – The switch.
1 Conditional statements Dept. of Computer Engineering Faculty of Engineering, Kasetsart University Bangkok, Thailand.
Flow of Control Part 1: Selection
Selection Boolean What is Boolean ? Boolean is a set with only two values : –true –false true and false are standard identifiers in Pascal, called Boolean.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand how decisions are made in a computer ❏ To understand the logical.
1 Boolean Expressions to Make Comparisons Boolean expression –Represents only one of two states –Expression evaluates to either true or false Expressions.
CHAPTER 4: Selection Control Structure. Objectives  Use the relational comparison operators  Learn about AND logic  Learn about OR logic  Make selections.
Programming Fundamental Slides1 Data Types, Identifiers, and Expressions Topics to cover here: Data types Variables and Identifiers Arithmetic and Logical.
Conditional Statement Chapter 8. Conditional Statements Are statements that check an expression then may or may not execute a statement or group of statement.
Decisions  Relational operators  Operate on two numbers or two Strings  ==, !=, >, >=,
Programming 1 DCT 1033 Control Structures I (Selection) if selection statement If..else double selection statement Switch multiple selection statement.
Flow of Control Unless indicated otherwise, the order of statement execution through a method is linear: one after the other in the order they are written.
Chapter 3 Boolean Expressions Section 3.2 Slides prepared by Rose Williams, Binghamton University Kenrick Mock, University of Alaska Anchorage.
Computer Programming TCP1224 Chapter 5 The Selection Structure.
Chapter 4 Making Decision Csc 125 C++ programming language Fall 2005.
COMPE 111 Introduction to Computer Engineering Programming in Python Atılım University
Visual Basic CDA College Limassol Campus COM123 Visual Basic Programming Semester C Lecture:Pelekanou Olga Week 4: Understand and implement Decisions.
Tutorial 4: The Selection Structure 1 Tutorial 4 The Selection Structure.
5.02B Decision Making Structure (part 2). Compound Boolean Expressions.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 11 So Many Paths … So Little Time.
Chapter 10 So Many Paths … So Little Time (Multiple-Alternative Selection Structures) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Chapter 4: Variables, Constants, and Arithmetic Operators Introduction to Programming with C++ Fourth Edition.
An Introduction to Programming with C++ Sixth Edition Chapter 5 The Selection Structure.
Conditional Control Structures Chapter 5 Review. The If Statement The if statement is a conditional control structure, also called a decision structure,
An Introduction to Programming with C++1 The Selection Structure Tutorial 6.
Conditional Statements A conditional statement lets us choose which statement will be executed next Conditional statements give us the power to make basic.
TUTORIAL 4 Visual Basic 6.0 Mr. Crone. Pseudocode Pseudocode is written language that is part-code part- English and helps a programmer to plan the layout.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Chapter 4: Decisions and Conditions
Java Programming Fifth Edition
Chapter 4: Decisions and Conditions
Chapter 4: Making Decisions.
Selection—Making Decisions
Multiple variables can be created in one declaration
The Selection Structure
Chapter 4: The Selection Structure
Expressions and Control Flow in JavaScript
Chapter 4: Making Decisions.
Programming with Microsoft Visual Basic 2008 Fourth Edition
An Introduction to Programming with C++ Fifth Edition
JavaScript conditional
Making Decisions in a Program
Computers & Programming Languages
Bools and simple if statements
Relational Operators Operator Meaning < Less than > Greater than
Objectives After studying this chapter, you should be able to:
Microsoft Visual Basic 2005: Reloaded Second Edition
Conditional Logic Presentation Name Course Name
Chapter 3: Selection Structures: Making Decisions
Boolean Expressions to Make Comparisons
Chapter 3: Selection Structures: Making Decisions
Selection—Making Decisions
Chapter 5: The Selection Structure
Presentation transcript:

Random Functions Selection Structure Comparison Operators Logical Operator

Functions– 10 Points QUESTION: When using the toupper() function in a comparison, you should be sure that everything you are comparing is lowercase. ANSWER: False

Functions– 20 Points QUESTION: The transform() function converts each of the characters contained in the range specified in the function’s first two arguments, beginning with the character whose location is specified in the first argument and continuing up to, but not including, the character whose location is specified in the second argument. ANSWER: True

Functions– 30 Points QUESTION: In C++, you can use the ____ function to convert a character to uppercase. ANSWER: toupper( )

Functions– 40 Points QUESTION: In C++, you can use the ____ function to convert a character to lowercase. ANSWER: tolower( )

Functions– 50 Points QUESTION: In C++ you can use the ____ function to convert a string to either uppercase or lowercase. ANSWER: transform( )

Selection Structure– 10 Points QUESTION: You use the selection structure when you want a program to make a decision or comparison and then select one of two paths, depending on the result of that decision or comparison. ANSWER: true

Selection Structure– 20 Points QUESTION: The condition in the selection structure specifies the decision you are making and is phrased so that it results in either a true or false answer only. ANSWER: true

Selection Structure– 30 Points QUESTION: The selection structure is also called the ____ structure. ANSWER: decision

Selection Structure– 40 Points QUESTION: The selection structure is one of the ____ programming structures you can use in a program. ANSWER: Three

Selection Structure– 50 Points QUESTION: The instructions following the condition of a selection structure are referred to as the ____ path. ANSWER: True

Comparison Operator– 10 Points QUESTION: Comparison operators are evaluated before any arithmetic operators in an expression. ANSWER: false

Comparison Operator– 20 Points QUESTION: In C++, comparisons with a precedence number of 2 are performed before comparisons with a precedence number of 1. ANSWER: false

Comparison Operator– 30 Points QUESTION: Comparison operators are often referred to as ____ operators. ANSWER: relational

Comparison Operator– 40 Points QUESTION: You use ____ to test for equality in C++. ANSWER: = =

Comparison Operator– 50 Points QUESTION: How many comparison operations are there? ANSWER: 6

Logical Operators– 10 Points QUESTION: The And and Or logical operators are evaluated before any arithmetic operators or comparison operators in an expression. ANSWER: false

Logical Operators– 20 Points QUESTION: Truth tables summarize how the computer evaluates the logical operators in an expression. ANSWER: True

Logical Operators– 30 Points QUESTION: Logical operators are sometimes referred to as ____ operators. ANSWER: Boolean

Logical Operators– 40 Points QUESTION: When the ____ logical operator is used to create a compound condition, all of the conditions must be true for the compound condition to be true. ANSWER: And

Logical Operators– 50 Points QUESTION: When the ____ logical operator is used, only one of the conditions must be true for the compound condition to be true. ANSWER: Or

Random– 10 Points QUESTION: If age is 60, the condition age 55 evaluates to false. ANSWER: false

Random– 20 Points QUESTION: Character literal constants are enclosed in double quotation marks. ANSWER: false

Random– 30 Points QUESTION: 5 – 2 > evaluates to ____. ANSWER: false

Random– 40 Points QUESTION: Most programming languages offer three forms of the selection structure: if, if/else, and ____. ANSWER: switch

Random– 50 Points QUESTION: You need to enter the ____ directive in any program that uses the transform() function. ANSWER: #include