CS 3377 Dollinger Exam 2 Questions
With Correct Answers
In Board Game assignment, we used a binary file to store the
| | | | | | | | | | | |
intermediate values (current balance for each player) primarily because
| | | | | | | |
A) the program kept track of the money instead of points
| | | | | | | | | |
B) the program used the player names instead of ID numbers
| | | | | | | | | |
C) the program ended after processing each transaction
| | | | | | |
D) the program may handle too much data that cannot fit in main
| | | | | | | | | | | | |
memory - CORRECT ANSWER✔✔-C) the program ended after
| | | | | | | |
processing each transaction | |
Including the initial parent process, the total number of the processes
| | | | | | | | | | |
(in total) will be ____ after executing the code segment below.
| | | | | | | | | |
|
if (fork() && fork()) { fork();}
| | | | |
A) 8 |
B) 4 |
,C) 16 |
D) 2 |
E) 5 - CORRECT ANSWER✔✔-4
| | | |
Including the initial parent process, the total number of the processes
| | | | | | | | | | |
(in total) will be ____ after executing the code segment below.
| | | | | | | | | | |
if (fork() < 0) {fork();}
| | | |
A)1 |
B)2 |
C)3 |
D)4 |
E)0 - CORRECT ANSWER✔✔-B) 2
| | | |
In "Data crunching using IPC" assignment, a computational network of
| | | | | | | | | |
processes connected by pipes is created based on the rst line in data.txt.
| | | | | | | | | | | |
|If the rst line contains a - b * c / d - e / f how many pipes are created to
| | | | | | | | | | | | | | | | | | | | | |
handle this computation? | |
A) 10 | |
B) 6 | |
, C) 11 | |
D) 15 | |
E) 5 - CORRECT ANSWER✔✔-C) 11
| | | | |
Given fork program as shown below, how many lines will be output?
| | | | | | | | | | | |
fork(); |
if (fork())
| |
| puts("I am the parent."); | | |
A) 1 |
B) 2 |
C) 4 |
D) 8 - CORRECT ANSWER✔✔-B) 2
| | | | |
With a C program (memory map), ____ stores the information that is
| | | | | | | | | | | |
saved each time a function is called. Each time a function is called, the
| | | | | | | | | | | | | |
address of where to return to and certain information about the caller's
| | | | | | | | | | | |
environment, such as some of the machine registers, are saved on ____.
| | | | | | | | | | |
A)Heap |
B) Garbage Collection Area
| | | |
C) Object Container
| | |
D) Shared Memory
| | |
With Correct Answers
In Board Game assignment, we used a binary file to store the
| | | | | | | | | | | |
intermediate values (current balance for each player) primarily because
| | | | | | | |
A) the program kept track of the money instead of points
| | | | | | | | | |
B) the program used the player names instead of ID numbers
| | | | | | | | | |
C) the program ended after processing each transaction
| | | | | | |
D) the program may handle too much data that cannot fit in main
| | | | | | | | | | | | |
memory - CORRECT ANSWER✔✔-C) the program ended after
| | | | | | | |
processing each transaction | |
Including the initial parent process, the total number of the processes
| | | | | | | | | | |
(in total) will be ____ after executing the code segment below.
| | | | | | | | | |
|
if (fork() && fork()) { fork();}
| | | | |
A) 8 |
B) 4 |
,C) 16 |
D) 2 |
E) 5 - CORRECT ANSWER✔✔-4
| | | |
Including the initial parent process, the total number of the processes
| | | | | | | | | | |
(in total) will be ____ after executing the code segment below.
| | | | | | | | | | |
if (fork() < 0) {fork();}
| | | |
A)1 |
B)2 |
C)3 |
D)4 |
E)0 - CORRECT ANSWER✔✔-B) 2
| | | |
In "Data crunching using IPC" assignment, a computational network of
| | | | | | | | | |
processes connected by pipes is created based on the rst line in data.txt.
| | | | | | | | | | | |
|If the rst line contains a - b * c / d - e / f how many pipes are created to
| | | | | | | | | | | | | | | | | | | | | |
handle this computation? | |
A) 10 | |
B) 6 | |
, C) 11 | |
D) 15 | |
E) 5 - CORRECT ANSWER✔✔-C) 11
| | | | |
Given fork program as shown below, how many lines will be output?
| | | | | | | | | | | |
fork(); |
if (fork())
| |
| puts("I am the parent."); | | |
A) 1 |
B) 2 |
C) 4 |
D) 8 - CORRECT ANSWER✔✔-B) 2
| | | | |
With a C program (memory map), ____ stores the information that is
| | | | | | | | | | | |
saved each time a function is called. Each time a function is called, the
| | | | | | | | | | | | | |
address of where to return to and certain information about the caller's
| | | | | | | | | | | |
environment, such as some of the machine registers, are saved on ____.
| | | | | | | | | | |
A)Heap |
B) Garbage Collection Area
| | | |
C) Object Container
| | |
D) Shared Memory
| | |