Sei sulla pagina 1di 9

INTERNATIONAL SCHOOL OF ASIA AND THE PACIFIC

Alimannao Hills, Peñablanca, Cagayan 3502

COLLEGE I
OF NFORMATION TECHNOLOGY AND ENGINEERING
Subject Code : CC 102
Subject Title : COMPUTER PROGRAMMING 1
Term : PRELIM
Semester : FIRST School Year: 2019-2020

Name: ________________________________ Year and Section: ____________


Proctor: _______________________________ Score: _____________________

I. Write your answer on the space provided beside the number in CAPITAL
LETTERS. Avoid erasures.

1. What is the output of this program?


#include
using namespace std;
int main()
{
int a;
a = 5 + 3 * 5;
cout << a;
return 0;
}
A. 35 C. 25
B. 20 D. 30

2. What is the output of this program?


#include < iostream >
using namespace std;
int main()
{
int a = 5, b = 6, c, d;
c = a, b;
d = (a, b);
cout << c << 't' << d;
return 0;
}

A. 5 6 C. 6 7
B. 6 5 D. none of the mentioned

3. What is the output of this program?


#include < iostream >
using namespace std;
main()
{
double a = 21.09399;
float b = 10.20;
int c ,d;
c = (int) a;
d = (int) b;
cout << c <<'t'<< d;
return 0;
}
A. 20 10 C. 21 10
B. 10 21 D. none of the mentioned

4. The if..else statement can be replaced by which operator?


A. Bitwise operator
B. Conditional operator
C. Multiplicative operator
D. none of the mentioned

5. The switch statement is also called as?


A. choosing structure C. certain structure
B. selective structure D. none of the mentioned

6. Which one is not a correct variable type in C++?


A. float C. int
B. real D. double

7. The following supports the use of operating system, EXCEPT:


A. It makes use of computer more convenient for user
B. Provide services that allows each application to execute safely
C. It contains a KERNEL
D. Guide the computer through orderly sets of actions

8. A C++ code line ends with ___


A. A Semicolon (;) C. A Comma (,)
B. A Fullstop(.) D. A Slash (/)

9. A ponter pointing to a variable that is B. Null Pointer


C. Empty Pointer
not initialized is called ____ D. Wild Pointer
A. Void Pointer
10. Default constructor has ____ arguments.
A. No argument C. Two Argument
B. One Argument D. None of these

11. Reusability of code in C++ is achieved through ____


A. Polymorphism C. Encapsulation
B. Inheritance D. Both A and B

12. In CPP, members of a class are ______ by default.


A. Public C. Protected
B. Private D. Static

13. In C++ Program, inline functions are expanded during ____


A. Run Time C. Debug Time
B. Compile Time D. Coding Time

14. A device than can perform computations and make logical decisions phenomenally
father than human beings can.
A. Computer C. CPU
B. System Unit d. Motherboard

15. C++ was originally developed by _________.


A. Ken Thompson
B. Bill Gates
C. UNIX at Bell Labs
D. Bjarne Stroustrup

16. The preprocessor directive #include is required if:


A. Console output is used C. Both console Input and Output is
B. Console input is used used
D. None of these

17. The operator << is called _________.


A. Insertion operator C. Instruction operator
B. Extraction operator D. Both A and C

18. The operator >> is called ______________.


A. An extraction operator C. Either A or B
B. A get operator D. An insertion operator

19. The C++ symbol << _________.


A. perform the action of sending the value of expression listed as its right to the outputs
strewn as the left.
B. is used to indicate the action from right to left
C. is adopted to resemble an arrow
D. All of the above

20. What is the output of the given program?


#include <iostream>
using namespace std;
int main() {
cout << "Enjoy yourself with C++!" << endl;
return 0;
}
A. Enjoy yourself with C++! C. Error on Line 4 <<endl function
B. Enjoy yourself with c++! D. None of the above

21. This allows the program to access all the information contained in the header file.
A. #include <iostream> C. int main()
B. using namespace std; D. return 0;

22. Predefined names in C++ are to be found in the ____________.


A. #include <iostream> C. int main()
B. using namespace std; D. return 0;

23. This is are all an example of a comment, EXCEPT:


A. /*……..*/ C. /*..//..*/
B. // D. /…/

24. Which of the following supports the idea of Moore’s Law?


A. The capacity of computers decreases with an increase in price
B. The capacity of computer approximately doubled with an increase in price
C. The capacity of computer approximately doubled without an increase in
price
D. The capacity of computer increases as the price decreases

25. ________ is the external parts of a computer.


A. Hardware C. System
B. Software D. Application

26. A device than can perform computations and make logical decisions more faster than
humans.
A. Computer C. CPU
B. System Unit d. Motherboard

27. The software that contains the core components of the operating systems is called
_________.
a. Operating System C. Kernel
b. System Software D. Application Software

28. A type of language that is using English-like abbreviations to represent elementary


operations.
A. Machine Language C. High Level Language
B. Assembly Language D. None of the above

29. _________ was developed in the mid 1980’s by Microsoft.


A. Windows C. Microchips
B. Microsoft Office D. Visual C++

30. ________ is also known as the manufacturing section that performs calculation.
A. Memory Unit C. Control Unit
B. Arithmetic Logic Unit D. Central Processing Unit

II. Match column A with the correct answer on column B, write only the
letter of answer on the blank provided at the left side of the test paper.

Column A Column B
____1. Extension of C Language a. Fields
____2. A leading manufacturer of b. Android
processors
____3. Header File. C++ standard c. #include <iostream>
input/output library file
____4. Greatest success of the open d. C++
source movement
____5. Group of characters or bytes e. Memory Unit
____6. Also known as the warehouse f. Linux
section
____7. Smallest Data Item g. Bits
____8. It is based from Linux and Java h. Multicore processor
____9. A region where your code resides i. namespace
____10. The brain of the computer j. CPU
____11. The programs than run on a k. Windows
computer
____12. It denotes exit status of the l. Software
application
____13. Identified by Gordon Moore m. Intel
____14. Approximately one billion bytes n. iostream
____15. A volatile type of memory o. Gigabyte
____16. The information that the p. Hardware
computer has processed
____17. The only language a computer q. Machine Language
can understand
____18. Group of related records r. 0
____19. A multiple processor integrated in s. CPU
a single chip
____20. A semicolon (;) is known as t. Moore’s Law
u. Termination statement
v. Output
w. Terabyte
x. Terminal
y. File
z. IBM

III. Fill the missing codes. 2 pts each

# include <iostream>
________________ (1)
int main()
{
char ________;(2)
float num1, num2;
cout << "Enter operator either + or - or * or /: ";
cin >> operator;
(3) ________ "Enter two operands: ";
cin >> (4)______ >> (5)______;

(6)_____________
{
case '+':
cout << "The sum of the two number is " << (7)________;
break;
case '-':
cout << "The difference of the two number is " << num1-num2;
break;
case '*':
cout << "The product of the two number is " << num1*num2;
break;
case '/':
cout << "(8)_______________________________ " << num1/num2;
break;
__________(9)
// If the operator is other than +, -, * or /, error message is shown
cout << "Error! operator is not correct";
break;
}
__________;(10)
}
#include <iostream>
using namespace std;
(11)_________;
int gVar2 = 2;

int main() {
char ch('A');
cout << "Value of gVar1: " << gVar1 _______(12);
cout << "Value of gVar2: " << _____ (13)<< endl;
cout << "Character in ch: " << _____(14) << endl;
int sum, number = 3;
sum= (15)_______+5;
cout << "Value of sum: " << sum << endl;
return 0;
}

IV. Written or manual coding. 10 pts. each

1. Write a program that outputs the following:

Output:
Oh what
A happy day!
Oh yes,
What a happy day!

a happy day!

Oh yes,

what a happy day!


2. Write a program that output the following:

Output:
Input x:
Input y:
The sum is:

a happy day!

Oh yes,

what a happy day!

“Repeat after me: I CAN DO THIS! I WILL ACE IT!”

Prepared by:

Jenyll T. Mabborang
Instructor

Checked by:

NORWAY T. SALUDARES, LPT, MIT


Program Coordinator

JUNE VERGEL P. QUEROL


Program Coordinator
Noted by:

CB RONNIE E. SUGAROL, MPBM


School Overseer

Approved by:

PRESENITA C. AGUON PH. D.


Vice President for Academic Affairs

Potrebbero piacerti anche