1/59
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Input
Any data the computer collects from people and from other devices
Output
responses from the input
Syntax
rule of language
A ___ structure can execute a set of statements only under certain circumstances
A) sequence
B) circumstantial
C) decision
D) Boolean
C; decision
A ___ structure provides one alternative path of execution
A) sequence
B) single alternative decision
C) one path alternative
D) single execution decision
B; single alternative decision
In pseudocode, the If-then statement is an example of a _____
A) sequence structure
B) decision structure
C) pathway structure
D) class structure
B; decision structure
A(n) _______ expression has a value of either true or false
A) binary
B) decision
C) unconditional
D) Boolean
D; Boolean
The symbols > < and == are all _______ operators
A) relational
B) logical
C) conditional
D) ternary
A; relational
A(n) ______ structure test a condition and then takes one path if the conditon is true, or another path if the condition is false
A) if-then statement
B) single alternative decision
C) dual alternative decision
D) sequence
C; dual alternative decision
You use a(n) _____ statement in psuedocode to write a single alternative decision structure
A) test-jump
B) if-then
C) if-then-else
D) if-call
B; if - then
You usee a(n) ______ statement in psuedocode to write a dual alternative decision structure
A) test-jump
B) if-then
C) if-then-else
D) if-call
C; if-then-else
A ______ structure allows you to test the value of a variable or an expression and then use that value to determine which statment or set of statements to execute
A) variable test decision
B) single alternative decision
C) dual alternative decision
D) multiple alternative decision
D; multiple alternative decision
A(n) _____ section of a select case statement is branched to if none of the case values match the expression listed after the select statement
A) else
B) default
C) case
D) otherwise
B; default
AND, OR, and NOT are _______ operators
A) relational
B) logical
C) conditional
D) ternary
B; logical
A compound Boolean expression created with the ______ operator is true only if both of its subexpressions is true
A) AND
B) OR
C) NOT
D) EITHER
A; AND
A compound Boolean expression created with the ______ operator is true if either of its subexpressions is true
A) AND
B) OR
C) NOT
D) EITHER
B; OR
The ____ operator takes a Boolean expression as its operand and reversees its logical value
A) AND
B) OR
C) NOT
D) EITHER
C; not
True/False; You can write any program using only sequence structures
False
True/False; A program can be made of only one type of control structure. You Cannot combine structures
False
True/False; A single alternative decision structure tests a condition and then takes one path if the condition is true, or another path if the condition is false
False
True/False; A decision structure can be nested inside another decision structure
True
True/False; A compound Boolean expression created with the AND operator is true only when both subexpressions are true
True
Short answer: Explain what is meant by the term conditionally executed
The program will only be executed if the user inputs a certain condition or it would be skipped.
Short Answer: You need to test a condition and then execute one set of statements if the condition is true. If the condition is false, you need to execute a different set of statements. What structure will you use?
If-else
Short Answer: If you need to test the value of a variable and use that value to determine which statement or set of statements to execute, which structure would be most straightforward to use?
switch-case
Short Answer: Briefly explain how the AND operator works
The different sets of expressions must be true in a boolean expression in order for the code to be executed
Short Answer: Briefly explain how the OR operator works
Only one set of the expressions must be true for the code to be executed
Short Answer: When determining whether a number is inside a range, which logical operator is it best to use?
AND
good way to define variable name
camelCase
Assignment statement example
Set price = 20
Math operators
Data type
Integer = stores only whole number
Real = whole or decimal numbers
string = any series of characters
Pseudo code
Fake code used as a model for programs; no syntax rules
named constant
a value that can't be changed
Comments
known as "internal documentation" ex: //
And operator
both conditions HAS TO BE TRUE
OR operator
only one needs to be true
Rational Operators
x > y; x < y; x >= y; x <= y; x == y; x != y
Strings comparing
use rational operators
code set up
cout statement
output statement; ex: cout << "hello world" << endl;
cin statement
read the input statement from user
single alternative decision
if - then
dual alternative decision
if-then-else
decision
A __ structure provides one alternative path of execution
single alternative decision
In pseudocode, the If-Then statement is an example of a
decision structure
relational
Dual alternative decision
if - then - else
Multiple alternative decision
Conditional
flag
What’s the term “conditionally executed”
program will only get executed if the user inputs a certain condition otherwise it gets skipped
if else
switch-case
AND