Shared Flashcard Set

Details

CSE 232 Exam 1
October 4 2012
30
Computer Science
Undergraduate 2
09/30/2012

Additional Computer Science Flashcards

 


 

Cards

Term

 

01. Assume that the person with the username "punch" issued the command shown in Figure 1. Which of the following will be the output when that same user enters "ls *s" as the next command?


  1. course.syllabus
  2. course.calendar
  3. course.calendar course.syllabus
  4. course.calendar course.syllabus test
  5. None of the above.

 

Definition

 

  1. course.syllabus

Term

02. Assume that the person with the username "punch" issued the command shown in Figure 1. Which of the following commands will make a copy of the file named "test" in that user’s home directory when it is entered by that same user as the next command?

  1. cp test ~punch/.

  2. cp test /user/punch

  3. cp test ~/test

  4. All of the above.

  5. None of the above.

Definition
4. All of the above.
Term

03. Which of the following statements about "g++" and the computers used for this course is correct?

  1. Underflow occurs when a floating point value requires an exponent which is too small to be represented.

  2. Overflow occurs when a floating point value requires an exponent which is too large to be represented.

  3. Roundoff error may be compounded during a series of floating point calculations.

  4. All of the above.

  5. None of the above.

Definition
  1. All of the above.

Term

04. Which of the following statements about "g++" and the computers used for this course is correct?

  1. An integer calculation which overflows will cause the program to terminate execution with an exception.

  2. A floating point calculation which overflows will cause the program to terminate execution with an exception.

  3. A floating point calculation which underflows will cause the program to terminate execution with an exception.

  4. All of the above.

  5. None of the above.

Definition
  1. None of the above.
Term

05. What output is produced by the statement labeled "Line 1" when the source code in Figure 2 is compiled and executed?

 

A) 3

B) 2

C) 1

D) 0

E) None of the above

Definition
A) 3
Term

06. What output is produced by the statement labeled "Line 2" when the source code in Figure 2 is compiled and executed?

A) 3

B) 2

C) 1

D) 0

E) None of the above

Definition
C) 1
Term

What output is produced by the statement labeled "Line 3" when the source code in Figure 2 is compiled and executed?

A) 3

B) 2

C) 1

D) 0

E) None of the above

Definition

B) 2

Term

8. What output is produced by the statement labeled "Line 4" when the source code in Figure 2 is compiled and executed?

A) 3

B) 2

C) 1

D) 0

E) None of the above

Definition

D. 0

Term

 

09. What output is produced by the statement labeled "Line 1" when the source code in Figure 3 is compiled and executed?

  1. 0
  2. 8
  3. 10
  4. 12
  5. None of the above.

 

 

Definition

3) 10

Term

10. What output is produced by the statement labeled "Line 2" when the source code in Figure 3 is compiled and executed?

A) 0 B) 1 C) 2 D) 3 E) None of the above.

Definition
B) 1
Term

11. What output is produced by the statement labeled "Line 3" when the source code in Figure 3 is compiled and executed?

  1. 0
  2. 1
  3. 2
  4. 3
  5. None of the above.

 

Definition

3.  2 

Term

12. What output is produced by the statement labeled "Line 4" when the source code in Figure 3 is compiled and executed?

  1. 0
  2. 1
  3. 2
  4. 3
  5. None of the above.
Definition
5.  None of the above
Term

13. What output is produced by the statement labeled "Line 1" when the source code in Figure 4 is compiled and executed?

  1. 8

  2. 7

  3. 4

  4. 3

  5. None of the above.

Definition
2. 7
Term

14. What output is produced by the statement labeled "Line 2" when the source code in Figure 4 is compiled and executed?

  1. 42

  2. 28

  3. 6

  4. 4

  5. None of the above.

Definition
1.  42
Term

15. Consider the source code in Figure 4. What term is used to describe the block of statements labeled "Line 3" through "Line 4"?

  1. Function invocation

  2. Function description

  3. Function declaration

  4. Function definition

  5. None of the above.

Definition
4.   Function definition
Term

16. Which of the C++ features is NOT contained in the source code shown in Figure 4?

  1. reference parameter

  2. identifier with block lifetime

  3. value parameter

  4. identifier with file scope

  5. implicit type conversion

Definition
5. implicit type conversion
Term

17. Consider the source code in Figure 5. What value will be displayed by the program when it is compiled and executed?

A) 44

B) 46

C) 56

D) 60

E) None of the above.

Definition
A) 44
Term
18. Consider the source code in Figure 5. Assuming that the address of "A[0]" is 600200 (base 10), what is the address of "A[5]"?
A) 600420 (base 10)
B) 600440 (base 10)
C) 600452 (base 10)
D) 600548 (base 10)
E) None of the above.
Definition
A) 600420 (base 10)
Term
19. Consider the source code in Figure 5. Assuming that the address of "A[0]" is 600200 (base 10), what is the address of "A[0].ID"?
A) 600200 (base 10)
B) 600226 (base 10)
C) 600228 (base 10)
D) 600230 (base 10)
E) None of the above.
Definition
B) 600226 (base 10)
Term
20. Consider the source code in Figure 5. Assuming that the address of "A[0]" is 600200 (base 10), what is the address of "A[0].Amount[2]"?
A) 600208 (base 10)
B) 600236 (base 10)
C) 600240 (base 10)
D) 600244 (base 10)
E) None of the above.
Definition
B) 600236 (base 10)
Term
21. What output is produced by the statement labeled "Line 1" when the source code in Figure 6 is compiled and executed?
A) 9
B) 10
C) 18
D) 20
E) None of the above.
Definition
E) None of the above.
Term

22. What output is produced by the statement labeled "Line 2" when the source code in Figure 6 is compiled and executed?

 

Definition
C) 17
Term
23. What output is produced by the statement labeled "Line 3" when the source code in Figure 6 is compiled and executed?
A) 11 12 13
B) 29
C) 25
D) 14
E) None of the above.
Definition
C) 25
Term
24. What output is produced by the statement labeled "Line 4" when the source code in Figure 6 is compiled and executed?
A) 11 12 13 14 15
B) 63
C) 29
D) 16
E) None of the above.
Definition
B) 63
Term
25. What output is produced by the statement labeled "Line 1" when the source code in Figure 7 is compiled and executed?
A) 30
B) 40
C) 247916
D) 247920
E) None of the above.
Definition
B) 40
Term
26. What output is produced by the statement labeled "Line 2" when the source code in Figure 7 is compiled and executed?
A) 30
B) 40
C) 247916
D) 247920
E) None of the above.
Definition
D) 247920
Term
27. What output is produced by the statement labeled "Line 3" when the source code in Figure 7 is compiled and executed?
A) 33
B) 43
C) 247919
D) 247932
E) None of the above.
Definition
D) 247932
Term
28. Assume the programmer wishes to dynamically allocate an array of 100 integers. Which of the following is a valid replacement for the comment labeled "Line 4" in Figure 7?
A) int new A[100];
B) new int A[100];
C) A = 100 new int;
D) new A = int[100];
E) None of the above.
Definition
E) None of the above.
Term
29. Consider the information shown in Figure 8. Assume that the user enters "make -f midterm.makefile" as the next command. Which of the following commands will be executed by the makefile?
I. g++ -c -Wall driver.cpp
II. g++ -c -Wall support.cpp
III. g++ -o midterm driver.o support.o
A) I, II and III.
B) I and II, but not III.
C) I and III, but not II.
D) II and III, but not I.
E) None of the above.
Definition
E) None of the above.
Term
30. Consider the information shown in Figure 8. Assume that the user enters "make -f midterm.makefile", executes an editor to modify the contents of "support.h", and then enters "make -f midterm.makefile" as the next command. Which of the following commands will be executed by the makefile?
I. g++ -c -Wall driver.cpp
II. g++ -c -Wall support.cpp
III. g++ -o midterm driver.o support.o
A) I, II and III.
B) I and II, but not III.
C) I and III, but not II.
D) II and III, but not I.
E) None of the above.
Definition
A) I, II and III.
Supporting users have an ad free experience!