wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CSnP - Sprint 2023 Midterm

Total questions: 77

Worksheet time: 1hrs 27mins

Name
Class
Date
1.

What is the standard input object?

(a)  

2.

Like cout, what file does cin require? (just the word)

(a)  

3.

Cin is use to read what from keyboard?

(a)  

4.

A mathematical (a)   is something that can be evaluated to produce a value.

5.

Char, short, unsigned short are automatically promoted to (a)  

6.

Coercion affects the (a)   used in a calculation. It does not change the type associated with a variable.

7.

What is used for manual data type conversion? (one word - lower case)

(a)  

8.

What occurs when assigning a value that is too large? (one word - lowercase)

(a)  

9.

What occurs when assigning a value too close to zero?

(a)  

10.

What are variables whose content cannot be changed during program execution?

(a)  

11.

What is the assignment operator? (it is a symbol)

(a)  

12.

What does x += 5; mean? (don't forget to end the statement)

(a)  

13.

What is a Manipulator Example for 2 decimal places? (not setw)

(a)  

14.

What is the data type that holds a single character? (lowercase)

(a)  

15.

What holds a sequence of characters? (lowercase)

(a)  

16.

What is the code segment to skip a single character? (don't forget to end the statement)

(a)  

17.

What function you use for the number of characters in a string? (NOT a code segment. it is a word with symbol)

(a)  

18.

What function do you use to put repeated characters in a string? (NOT a code segment. it is a word with symbol)

(a)  

19.

What math library function do you use for absolute value? (one word - lowercase)

(a)  

20.

What function do you use to return a random number between 0 and the largest int the computer holds? (NOT a code segment. it is a word with symbol)

(a)  

21.

What relational operator means not equal to? (no spaces)

(a)  

22.

What relational operator means equal to? (no spaces)

(a)  

23.

Relational expressions are (a)   (uppercase)

24.

For Formatting an Output, you can control how output displays for numeric and string data. What is the header file to use? (one word / lowercase) *Note. Reconfirming. This is from Chapter 3.

(a)  

25.

What statement supports the use of a decision structure, giving a program more than one path of execution? (one word / lowercase)

(a)  

26.

What Allows statements to be conditionally executed or skipped over? (one word. lowercase)

(a)  

27.

How the if Statement Works. If (condition) is true, then the statement(s) in the body are (a)   .

28.

If (condition) is false, then the statement(s) are (a)   .

29.

"if" is a keyword. It must be

a)

uppercase

b)

lowercase

30.

An expression whose value is 0 is considered (a)   .

31.

A variable that signals a condition

(a)  

32.

Flag is usually implemented as a (a)  

33.

An if/else statement allows a (a)   between statements depending on whether (condition) is true or false

34.

It is (a)   to test for equality when working with floating point numbers.

35.

Is used with a set of if/else if statements

(a)  

36.

What program execution is controlled by user selecting from a list of actions?

(a)  

37.

What is an if statement that is part of the if or else part of another if statement?

(a)  

38.

What are used to create relational expressions from other relational expressions?

(a)  

39.

What is if an expression using the && operator is being evaluated and the subexpression on the left side is false, then there is no reason to evaluate the subexpression on the right side. It is skipped.

(a)  

40.

What is inspecting input data to determine if it is acceptable?

(a)  

41.

The (a)   of a variable is the block in which it is defined, from

42.

What Is used to stop execution in the current block?

(a)  

43.

A (a)   statement is a natural choice for a menu-driven program.

44.

What is a part of a program that may execute > 1 time (i.e., it repeats)?

(a)  

45.

What can be omitted if there is only one statement in the body of the loop?

(a)  

46.

What is an execution of the loop body?

(a)  

47.

What is a pretest loop (the condition is evaluated before the loop executes)?

(a)  

48.

What must the loop become so the contained code allows the condition to eventually be exited?

(a)  

49.

Related to previous question....Otherwise, you have an (a)   loop (i.e., a loop that does not stop)

50.

(a)   are an appropriate structure for validating user input data

51.

(a)   adds one to a variable

52.

(a)   subtracts one from a variable

53.

(a)   : a variable that is incremented or decremented each time a loop iterates

54.

(a)   must be initialized before entering loop

55.

___ _____: an accumulated sum of numbers from iterations of loop

(a)  

56.

(a)   : a variable that holds running total

57.

(a)   : a value in a list of values that indicates the end of the list

58.

__-__: a post test loop (condition is evaluated after the loop executes)

(a)  

59.

A do-while loop body always executes at least (a)  

60.

A do-while loop execution continues as long as the condition is (a)   .

61.

A ___-____ loop can be used in a menu-driven program to bring the user back to the menu to make another choice

(a)  

62.

To simplify the processing of user input, use the (a)   (‘to uppercase’) or tolower (‘to lowercase’) function. This allows you to check user input regardless of the case of the input.

63.

It is a pretest loop that executes zero or more times

a)

do-while

b)

for loop

c)

while

64.

The last of three parts of a for loop parameter does the initialization.

a)

True

b)

False

65.

If test is false the first time it is evaluated, the body of the loop will not be executed.

a)

True

b)

False

66.

In for loops, you can not omit initialization even if already done

a)

True

b)

False

67.

A ___ ___ is a loop that is inside the body of another loop

(a)  

68.

(a)   can be used to terminate the execution of a loop iteration

69.

You can use (a)   to go to the end of the loop and prepare for next iteration

70.

We can use a (a)   instead of the computer screen for program output

71.

Files allow data to be (a)   between program executions

72.

contains information encoded as text, such as letters, digits, and punctuation. It can be viewed with a text editor such as Notepad.

a)

Text file

b)

Binary file

73.

contains ---- (0s and 1s) information that has not been encoded as text. It cannot be viewed with a text editor.

a)

Text file

b)

Binary file

74.

Chapter 3 - Programming Challenge 7, Average Rainfall . This program calculates the average rainfall for a 3-month period. (enter the code)

4 lines
75.

Chapter 3 - Programming Challege 14, Celsius to Fahrenheit. This program converts a Celsius temperature to Fahrenheit. (code segment)

4 lines
76.

Chapter 4 - Programming Challenge 11, Geometry Calculator. This menu-driven program computes the area of various geometric figures.

4 lines
77.

Chapter 5 - Programming Challenge 9, Weight Loss. This program creates a table displaying a dieting person's weight over a period of 6 months if they lose 4 pounds a month. Students may choose to use a different type of loop.

4 lines