COmpsci

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

1/68

flashcard set

Earn XP

Description and Tags

test

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

69 Terms

1
New cards

What is the correct conditional statement to determine if x is between 19 and 99?

(x >= 19 && x <= 99)

2
New cards

The braces for a loop define the ________ of the loop.

body

3
New cards

In a compound logical and (&&) expression, the evaluation of the expression stops once

one of the terms of the expression is false. This is known as ________ evaluation

Short circuit Evaluation

4
New cards

________ is the decimal number associated with the ASCII character '0'

48

5
New cards

A loop that always executes the loop body at least once is known as a ________ loop.

do while

6
New cards

The format specifier used to tell printf to expect a double precision floating point number

is a percent sign followed by the character(s)

lf

7
New cards

Each time a loop body executes is known as an

iteration

8
New cards

if-else statements that are inside other if-else statements are said to be

nested

9
New cards

When must we use braces to define the body of a conditional expression?

more then one statement

10
New cards

int myValue; is called a ________.

Integer

11
New cards

The portion of the printf function call within the double quotes is called the

format string

12
New cards

________ is the decimal number -42 converted to an 8 bit binary number using 2's

complement notation.

10101111

13
New cards

What is the opposite of ( x < 20 && x > 12)?

(x>= 20 || x <= 12)

14
New cards

Is printf used for input or output?

output

15
New cards

Write the loop condition to continue a while loop as long as x is negative.

x < 0

16
New cards

________ is the decimal number 42 converted to an 8 bit binary number using 2's

complement notation.

0101010

17
New cards

A switch statement variable must be ________.

int type

18
New cards

________ is a type whose values are defined by a list of constants of type int

Enum

19
New cards

A loop that iterates one too many or one too few times is said to be

Off by one error

20
New cards

A ________ loop always executes the loop body at least once, regardless of the loop

condition.

do while

21
New cards

The code following the ________ case is executed if none of the other cases are matched in

a switch statement.

default

22
New cards

Variables defined inside a set of braces are said to be ________ to that block of code

local

23
New cards
24
New cards

A ________ expression is an expression that can be thought of as being true or false.

boolean

25
New cards

The format specifier used to tell scanf to expect a double precision floating point number is

a percent sign followed by the character(s) ________.

%lf

26
New cards

Each repetition of a loop body is called ________.

iteration

27
New cards

A compound statement that contains variable declarations is called a ________.

block

28
New cards

The compiler always pairs an else with ________.

most previous

unmatched if

29
New cards

Converting from one type to another is called

type casting

30
New cards

Write the code to convert the value in an integer variable named count to a temporary

double

(double) count

31
New cards

Algorithms are typically described in

pseudocode

32
New cards

When you want to execute a function in your program, you would make a function

call

33
New cards

The ________ of a variable is where that variable can be used

scope

34
New cards

In the following function declaration, the variable size is known as a ________.

int myFunction ( int size);

formal parameter

35
New cards

Constant variables that might be used in different functions should be

global

36
New cards

The absolute value function abs is located in the ________ library

stdlib.h

37
New cards

Variables that are declared inside a function are said to be ________ to that function

local

38
New cards

#include math.h is known as an

include directory

39
New cards

problem solving approach that starts with the big problem and breaks it down into

smaller pieces is called

top down design

40
New cards

The black box analogy demonstrates the concept of

procedural abstraction

41
New cards

What is the output produced by the following code fragment?

int i 3;

printf("%.2f\n", sqrt( pow(i,4.0) ) );

9

42
New cards

What is the value of (pow(2,sqrt(9.0) ceil(0.99)))?

16

43
New cards

When the address of the actual argument is passed to the formal parameter, this allows us

to mimic a parameter passing mechanism called ________.

Pass by reference

44
New cards

Using functions in a program is called

procedural abstraction

45
New cards

What is the correct way to call the following function?

void setDisplay( void );

setDisplay();

46
New cards

The items passed to a function are called

arguments

47
New cards

The & operator is called the ________ operator.

address of

48
New cards

If we want to test if a given function works correctly, we would write a ________ to test it

driver

49
New cards

A ________ is a main program that only checks that functions execute correctly

driver

50
New cards

A ________ is a simplified version of a function used to test the main program

stub function

51
New cards

What type of value does a void function return?

none

52
New cards

Testing a program with values that are close to values that will change the execution of a

program is called ________.

boundary testing

53
New cards

The values or variables listed in the function declaration are called ________ to the

function.

formal parameters

54
New cards

What symbol is used to signify that a parameter is a pointer?

*

55
New cards

What is the most appropriate way to call the doThings function? Assume that you have

two variables named var1 and var2 defined as follows.

int var1;

float var2;

void doThings(float x, int y);

doThings(var2, var1);

56
New cards

Pre and post conditions for a function should be written (before/after) the function

definition is written.

before

57
New cards

The function used to open a file and return a FILE pointer for that file is ________.

fopen

58
New cards

When a file fails to open, fopen returns or evaluates as ________.

Null

59
New cards

The format specifier to display floating point numbers in scientific notation is the percent

sign followed by the letter: ________

%e

60
New cards

The format specifier that always shows the decimal point to display floating point numbers

is the percent sign followed by the letter

f

61
New cards

"\n" is a ________ and '\n' is a ________.

C string, single char

62
New cards

Write the format specifier used to change the number of decimal places displayed in a

floating point number to 3 decimal places.

%.3f

63
New cards

Which functions read one character even if that character is a blank space?

fgetc, getc, getchar

64
New cards

The format specifier to display floating point numbers in the shortest notation is the

percent sign followed by the letter: ________

%g

65
New cards

When you are finished using a file you should close the file using the function

fclose

66
New cards

________ is the safe function used to get a restricted length c string from a file or the

keyboard.

fget_s

67
New cards

The special character used to mark the end of a C string is called the ________ character

null terminator

68
New cards

scanf, fscanf and sscanf return ________ or ______.

NOC or EOF

69
New cards

All data is input and output as ________ data.

binary