Multiple-choice section

advertisement
CS208
Final Exam
Multiple-choice section
Given the following C++ Program
#include <iostream>
using namespace std;
main ()
{
int N1, N2, N3;
int NN;
cout << “Enter a value for N1:”; cin >> N1;
cout << “Enter a value for N2:”; cin >> N2;
cout << “Enter a value for N3:”; cin >> N3;
if ( N1 < N2)
NN = N1;
else NN = N2;
if (N3 < NN)
NN = N3;
cout << endl << NN << endl;
}
The following 2 Questions refer to the program contained above and its operation.
1. (4 Pt.) Given the following values: N1= 13, N2= 7, and N3= 10 What value will be printed for
NN?
a.
b.
c.
d.
NN = 7
NN = 10
NN = 13
None of the above
2. (4 Pt.) The function of the above program is to?
a.
b.
c.
d.
Find and display the smallest number from 3 numbers
Find the largest number from 3 numbers
Don’t know
Display the third number
Rev4 2/12/2016
Page | 1
Given the following Assembly Program
INP 08
LDA 08
INP 09
LDB 09
MUL
STR 10
PNT 10
STP
The following 2 Questions refer to the program contained above and its operation.
3. (2 Pt.) What is accomplished by the first two program instructions INP 08 and LDA 08?
a.
b.
c.
d.
Get a value from the user and divide it
Get a value from the user and store it in memory cell 09
Get a value from the user and store it in memory cell 08
Display the value in memory cell 08
4. (2 Pt.) The program is ___________________________________ ?
a.
b.
c.
d.
Subtracting 2 numbers and displaying the difference
Multiplying 2 numbers and displaying the product
Adding 2 numbers and displaying the sum
None of the above
5. (2 Pt.) TRUE / FALSE: The condition code register/status register holds the result of a compare
operation. ________________
6. (2 Pt.) TRUE / FALSE: The MS-DOS operating system like Unix has advanced memory management,
process management and networking capabilities. ______________
7. (2 Pt.) TRUE / FALSE: Time-sharing systems allow many users to interactively use the computer at the
same time. ______________
8. (2 Pt.) TRUE / FALSE: Two of the major jobs of an operating system is to allocate computer resources
to applications and schedule processes (running programs) . ____________
Rev4 2/12/2016
Page | 2
9. (2 Pt.) TRUE / FALSE: The UNIX operating system does not allow more than one program to be
executed at the same time. ______________
10. (2 Pt.) The 2 wild card symbols for DOS and UNIX operating systems are:
a
b
c
d
*, &
$, &
*, ?
?, .
Written section:
Answer the following problems and type your answers in the form
11. (3 Pt.) Compare higher order language (HOL) to assembly language (Talk about Pros and Cons).
12. (3 Pt.) Explain the difference between compiling and executing a program.
13. (4 Pt.) Consider the following C++ program:
include <iostream>
using namespace std;
main ()
{
int x
y;
cout << “ Enter a number for x: “ ; cin << x ;
cout >> “ Enter a number for y: “ cin >> y ;
sum = x + y ;
cout << “the sum of x + y is:” << “sum” << endl;
{
Identify any four errors in the above program.
14. (4 Pt.) List the different registers inside the CPU and explain their tasks
15. (10 Pt.) Write an assembly language program (develop the C++ program first) that will do the following:
 Accept keyboard input of an integer number N;
 Find if the number N is EVEN or ODD;
 Print (output) 1 if the number is odd or 2 if the number is even.
Rev4 2/12/2016
Page | 3
16. (3 Pt.) All system software has a shell; explain what is the shell.
17. (5 Pt.) Discuss the four-implementation strategies for handling Information Systems conversion.
18. (5 pt.) Name the deliverable (output) for each phase of the SDLC (Systems Development Life
Cycle)
Rev4 2/12/2016
Page | 4
Download