Programming for Engineers

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

1/65

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:03 PM on 2/5/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

66 Terms

1
New cards

The linker creates____

an executable image

2
New cards

What is bandwidth?

information carrying capacity

3
New cards

____ involves reworking programs to make them clearer and easier to maintain while preserving their correctness and functionality.

Refactoring

4
New cards

Which of the following statements is true?

Compilers translate high-level language programs into machine language programs

5
New cards

Which of the following is going to be the key programming methodology for the next decade?

object-oriented programming

6
New cards

Which of the following would not be considered hardware?

an operating system

7
New cards

Which of the following languages was an ancestor of C?

B

8
New cards

A ____ is an electronic collection of data that’s organized for easy access and manipulation.

database

9
New cards

______ models software in terms similar to those that people use to describe real-world object

Object-oriented design

10
New cards

Programs or data not actively being used by the other units are placed on the ____

secondary storage unit

11
New cards

A computer can directly understand only its own ____

machine language

12
New cards

Which of the following is not an advantage of object-oriented programming?

None of the above—these area all advantages of object-oriented programming

13
New cards

Assemblers

Convert assembly language into machine language

14
New cards

Which of the following statements is false?

Windows is an open-source operating system

15
New cards

Which of the following is not one of the three general types of computer languages

Spoken languages

16
New cards

____ are essentially reusable software components that model items in the real world

objects

17
New cards

Which operation will find the remainder when 15 is divided by 6"?

15 % 6

18
New cards

Which statement is false?

In the statement:

sum = integer1 + integer2

The spaces around each of the binary operators in the statement of part a) are required.

19
New cards

Which of the following multiple word variable names doesn’t conform to the good programming practices in the text?

multiplewordvariablename

20
New cards

Which statement is false?

The equals sign (=) isn’t an operator

21
New cards

Evaluate the expression

3 × 4 % 6 + 4 × 5

20

22
New cards

Which of the following isn’t a valid escape sequence?

\~

23
New cards

The_______sign is also known as the________operator

= , assignment

24
New cards

Which of the following is false?

In a printf statement, the comma that separates the format con-trol string from the expressions to be printed is placed inside the format control string

25
New cards

In a printf, a backslash is printed by enclosing in quotes

\ \

26
New cards

Which of the following statements should be used in secure C programming to display the string “Welcome
not followed by a new-line character?

printf( “%s”, “Welcome”);

27
New cards

In the line

int main()

the parentheses that main is a program building block called a

function

28
New cards

Which of the following is an invalid identifier (variable name)?

5test

29
New cards

Which of the following statements about the inclusion of <stdio.h> is false?

It’s required

30
New cards

Which expression is true?

The expression y = a x x + b * x + c does exponentiation without an exponentiation operator.

31
New cards

Which statement prints “hi” on the screen?

puts("hi");

32
New cards

Which statement is false?

The statements in an if statement must be indented.

33
New cards

The two key attributes of an algorithm are:

actions and order of actions

34
New cards
35
New cards

Counter-controlled iteration is often called __________ iteration because the number of iterations is known before the loop begins executing.

definite

36
New cards

Which of the following encompasses the other three?

control structure

37
New cards

Which of the following will generate an error?

puts(answer == 7 ? "correct" : "incorrect");

38
New cards

Which is not a C iteration statement?

do…for

39
New cards

The __________ is called a multiple selection statement.

switch

40
New cards

Which statement is true about the contents of a correct diamond symbol in a correct flowchart.

It must contain a condition or expression that can be either true or false.

41
New cards

Which statement is false?

The if selection statement can have only one statement in its body.

42
New cards

Which of the following statements is true about undefined behavior, which can leave a system open to attack?

Adding two integers can result in arithmetic overflow, which can cause undefined behavior.

43
New cards

A correct decision symbol has __________ flowlines emerging from it.

2

44
New cards

Which statement is true?

The sequence structure is essentially built into C.

45
New cards
46
New cards

Specifying the order in which statements are to be executed in a computer program is called

program control

47
New cards

Which statement is false?

A carefully prepared pseudocode program is only a beginning; it still takes a tremendous amount of work to convert a pseudocode program into a C program.

48
New cards

The empty statement is represented by placing __________ where a statement would normally be.

;

49
New cards

The diamond flowcharting symbol is also called the __________ symbol.

decision

50
New cards

Which of the following statements correctly prints “Passed” if the student’s grade is greater than or equal to 60 and “Failed” if the student’s grade is less than 60? [The quotes, of course, should not print.]

printf("%s\n", grade >= 60 ? "Passed" : "Failed");

51
New cards

Consider the following code, assuming that x is an integer variable with an initial value of 12:

if (x = 6) {
   printf("%i", x);
}
 
What is the output?

6

52
New cards

An example of a unary operator is

an increment operator

53
New cards

Which statement about a correct for statement with an initialization expression, a loop-continuation test, an increment expression and a loop body is false?

The initialization is performed each time through the loop.

54
New cards

Which is not an iteration statement?

continue

55
New cards

What is produced by a for statement with a correct body and with the following header
      for (i = 20; i >= 2; i += 2)

an infinite loop

56
New cards

Which statement is false?

In counter-controlled iteration, the control variable is always incremented by 1 each time the group of instructions is performed.

57
New cards

Which of the following is not specified by the following code segment:
      for (c = 1; c <= 10; c++)

body statement of the loop

58
New cards

Which statement is false?

Comma operators evaluate lists of expressions from right to left.

59
New cards

Which statement is false?

Assignments in C produce a value, namely the value that the left-hand side of the assignment had prior to the assignment.

60
New cards

Which statement is true?

The loop body of a correct do … while iteration statement is always executed at least once.

61
New cards

The comma operator is most often used in __________ statements.

for

62
New cards

Which of the following is false?

a continue statement can never appear in the else part of an if statement.

63
New cards

Which statement regarding the switch statement is false?

The default case is required.

64
New cards

In C, the condition 4 > y > 1

does not evaluate correctly and should be replaced by (4 > y && y > 1)

65
New cards

Which of the following is an incorrect expression to increment c by 1 in the increment expression of a for “header?”

c + 1 = c

66
New cards

Which statement is true?

In the “Rules for Forming Structured Programs (and Structured Flowcharts),” the rule that states, “Any rectangle (action) can be replaced by any control statement” is called the “nesting rule.”