comp sci test prep chap 1-2

0.0(0)
studied byStudied by 0 people
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/59

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

60 Terms

1
New cards

Input

Any data the computer collects from people and from other devices

2
New cards

Output

responses from the input

3
New cards

Syntax

rule of language

4
New cards

A ___ structure can execute a set of statements only under certain circumstances

A) sequence

B) circumstantial

C) decision

D) Boolean

C; decision

5
New cards

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

6
New cards

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

7
New cards

A(n) _______ expression has a value of either true or false

A) binary

B) decision

C) unconditional

D) Boolean

D; Boolean

8
New cards

The symbols > < and == are all _______ operators

A) relational

B) logical

C) conditional

D) ternary

A; relational

9
New cards

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

10
New cards

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

11
New cards

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

12
New cards

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

13
New cards

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

14
New cards

AND, OR, and NOT are _______ operators

A) relational

B) logical

C) conditional

D) ternary

B; logical

15
New cards

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

16
New cards

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

17
New cards

The ____ operator takes a Boolean expression as its operand and reversees its logical value

A) AND

B) OR

C) NOT

D) EITHER

C; not

18
New cards

True/False; You can write any program using only sequence structures

False

19
New cards

True/False; A program can be made of only one type of control structure. You Cannot combine structures

False

20
New cards

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

21
New cards

True/False; A decision structure can be nested inside another decision structure

True

22
New cards

True/False; A compound Boolean expression created with the AND operator is true only when both subexpressions are true

True

23
New cards

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.

24
New cards

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

25
New cards

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

26
New cards

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

27
New cards

Short Answer: Briefly explain how the OR operator works

Only one set of the expressions must be true for the code to be executed

28
New cards

Short Answer: When determining whether a number is inside a range, which logical operator is it best to use?

AND

29
New cards

good way to define variable name

camelCase

30
New cards

Assignment statement example

Set price = 20

31
New cards

Math operators

knowt flashcard image
32
New cards

Data type

Integer = stores only whole number

Real = whole or decimal numbers

string = any series of characters

33
New cards

Pseudo code

Fake code used as a model for programs; no syntax rules

34
New cards

named constant

a value that can't be changed

35
New cards

Comments

known as "internal documentation" ex: //

36
New cards

And operator

both conditions HAS TO BE TRUE

37
New cards

OR operator

only one needs to be true

38
New cards

Rational Operators

x > y; x < y; x >= y; x <= y; x == y; x != y

39
New cards

Strings comparing

use rational operators

40
New cards

code set up

41
New cards

cout statement

output statement; ex: cout << "hello world" << endl;

42
New cards

cin statement

read the input statement from user

43
New cards

single alternative decision

if - then

44
New cards

dual alternative decision

if-then-else

45
New cards
46
New cards
term image

decision

47
New cards

A __ structure provides one alternative path of execution

single alternative decision

48
New cards

In pseudocode, the If-Then statement is an example of a 

decision structure

49
New cards
term image

relational

50
New cards
term image

Dual alternative decision

51
New cards
term image

if - then - else

52
New cards
term image

Multiple alternative decision

53
New cards
term image

Conditional

54
New cards
term image

flag

55
New cards
term image
knowt flashcard image
56
New cards

What’s the term “conditionally executed”

program will only get executed if the user inputs a certain condition otherwise it gets skipped

57
New cards
term image

if else

58
New cards
term image

switch-case

59
New cards
term image

AND

60
New cards