Quiz2-InputProcessingOutput Flashcards

1
Q

The structure of the camelCase naming convention is to write the first word of the variable name in lowercase letter and then to capitalize the first character of the second and subsequent words. (T/F)

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The following two expressions will always yield identical results: (T/F)
(a + b) / c
a + b / c

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

An uninitialized variable is a variable that has been declared and automatically initialized to zero. (T/F)

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A sequence of characters that is used as data is called a String. (T/F)

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In a flowchart, the symbol that represents an assignment statement is an oval. (T/F)

A

False
Not oval that’s start end
it’s a processing symbol (rectangle)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Pseudocode is often used to plan out a program because the programmer does not have to worry about syntax rules. (T/F)

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A variable is a storage location in memory that is represented by a name and can hold different values during the execution of the program. (T/F)

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In a mathematical expression, addition and subtraction will be evaluated before multiplication (T/F).

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Variable names cannot include spaces. (T/F)

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The variable name myBookTitle
is written in camelCase convention. (T/F)

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Flowcharts and pseudocode documents are the same thing.(T/F)

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which of the following error types produces incorrect results but does not prevent the program from running?

A) Logic

B) Syntax

C) Human

A

A) Logic errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The program development cycle is made up of _____ steps that are repeated until no errors can be found in the program.

A

5 steps are:
1. Requirements/analysis info
2.Designing
3.Coding
4.Testing
5.Implementation/Deployment to an audience

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

_________ is an informal language used by programmers to create models of programs.

A

Pseudocode

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

A(n) __________ is a diagram that graphically depicts the steps that take place in a program.

A

Flowchart

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The __________ structure consists of a set of statements that execute in the order in which they appear.

A

Sequence

17
Q

A(n) ___________ symbol is used for an assignment statement in a flowchart.

A

Processing symbol (Rectangle)

18
Q

The __________ operator is used to raise 5 to the second power.

A

Caret symbol

19
Q

What is the value of the following expression?
12 - 4*3 / 2 + 9

A

15
FOLLOW PEMDAS UNLESS INDICATED BY ()
4*3=12
12/2=6
12-6=6
6+9=15

20
Q

What is the value of the following expression?
(12 - 4) *3 / 2 + 9

A

21
DO PARANTHESIS FIRST
THEN PEMDAS LEFT TO RIGHT
(12-4)=8
8*3=24
24/2=12
12+9=21

21
Q

Which of the following is NOT a variable data type?

Numeral, Real, String, Integer.

A

Numeral

22
Q

A(n) __________ is a name that represents a value which cannot be changed during the program’s execution.

A

Named constant

23
Q

The process of stepping through each of a program’s statements, one by one to see what each statement does is known as ____________.

A

Hand tracing

24
Q

The following is an example of a(n) _____________ statement.

Set rate = 6.25

A

Assignment
(would be in the rectangle)

25
Q

Which of the following is NOT an actual programming language?

C++, Java, Pseudocode, Python, HTML

A

Pseudocode

26
Q

What is the first step of the program development cycle?

A) Write the code

B) Correct for Syntax errors

C) Design the program

A

C) Designing the Code

27
Q

What term is used for a string that appears in the actual code of a program?

A

literal string

28
Q

What symbol is used to mark the beginning and end of a string?

A

Quotation marks (“)double (‘)single

29
Q

A variable declaration typically specifies the variable’s _________ and ________.

A

Name, Data Type

30
Q

Which of the following would cause an error in a program?

A) Attempting to store a floating-point value in a variable with Integer data type

B) attempting to store a floating-point value in a variable with String data type

C) attempting to store an Integer in a variable with String data type.

D) ALL of these would cause errors

A

D) ALL of these would cause errors
syntax errors specifically

31
Q

What is the value of the variable
result in the following expression?

Set result = 6 + 8 * 4 / 2

A

22
PEMDAS
8*4=32
32/2=16
6+16=22

32
Q

What is the value of the variable result in the following expression?

Set result = (6 + 8) * 4 / 2

A

28
PARANTHESIS then PEMDAS
6+8=14
14*4=56
56/2=28

33
Q

What is the value of the variable result in the following expression?

Set result = (6 + 8) / 4 * 2

A

7
6+8=14
14/4=3.5
3.5*2=7

34
Q

What is the error in the following pseudocode?

Display “What is your name?”
Input userName
Declare String userName

A

userName has been used (line 2) BEFORE it is declared (line 3)

35
Q

What is the error in the following pseudocode?

Declare String user
Display “How many widgets do you want to buy?”
Input user

A

The input variable “user” was declared a String. But “user” should be a number (integer or real) not a string (characters).

36
Q

What is the error in the following pseudocode?

Declare Integer widgets
Declare Real cost
Set widgets = 3.5
Set cost = widgets * 5

A

widgets was declaed as an Integer but it should be a REAL because the value= 3.5.
integers cannot hold a floating-point values (numbers with decimals or negatives).

36
Q
A
37
Q
A