You are on page 1of 9

SET 1.

Multiple Choice 1-9 Part 1 (Random Q&A)


These are the ones that will come out of 9 multiple choices. I don’t remember the letters in
but just look for the answer to the choices in case these will come out.

Question: How many characters in 8 bit = Answer is 256


Question: SDLC Example = Answer is Spiral and Evolution
Question: About Object Oriented
Programming? = Answer is Inheritance and Encapsulation
Question: Loop with example, question
What is the output? = Answer is 6 only
Question: About Number System
conversion = Answer is int to char
Question: Sample codes, the question
is what being the outcome = Answer is Runtime Error
Question: Find the best algorithms
to choose from, there are variables A, = Answer is Let’s say X will be the
B and C choose which is the best highest.
algo to know the highest variable
IF A>B THE
ON X=A
ELSE X=B
IF C>X THEN X=C
8 and 9 (Just analyze the question Pseudocode is my syntax there
and choice the best answer, but in the exam is PASCAL LANG.
nakalimutan na ang question and
choices answer)

Program Simulation Part 2 and 3 (Random Q&A)


Output Answer

1. Something like this ang nasa question sa set na eto


(5,10,15………….40.45,50) #include <iostream>
answer na agad isulat nyu sa answer sheet using namespace std;
int main ()

{
For (int iloop=0; iloop <10; iloop++)

{
cout <<5*(iloop+1) <<”,”;
}
return 0;

}
2. #include <iostream> Create a program that will display
using namespace std;
int main () 11111
2222
{ 333
44
int i, j; 5
for (i=1; i<=5; i++)
{
for (j=5; j>=i; j--)
{
cout <<i;
}
cout << "\n";
}
return 0;
}

3. Sample flowchart that has a process inside, the question is what is the answer in the blank
process?

The answer is simply “ x < i “.

4. 3 functions simulate, the syntax is PASCAL Programming (just search for sample codes of Pascal PL
in the internet) The answer here is the final values of 3 variables. Ang given number are 456. It’s a
bit tricky because the variables will be modified within the function then pass it to another
function with current values.

Answer ko ditto is choices number “3” if I remember, pwede nyu dn e’analyze ulit.

5. Pseudocode program, you have something to do.

Answer ko dito is choices number “5”.

Note: Program simulation of set 1.1 specifically sa number 4 and 5, just look for the sample
correct pseudocode and PASCAL PL syntax in the internet para sure kayo sa answer nyu.
SET 1.5

Multiple Choice 1-9 Part 1


Based from the experience of my previous examinee batch, Multiple choice in Set 1.5 is more
on basic programming, arrays, data structure and SDLC. Para sure na sure guys, just watch the video
tutorial of PinoyEinstein.

Program Simulation Part 2 and 3


1. Combination of X & Y that makes the statement true. (3 * x) - (4 * y) > = 30

Code/Answer:

#include <iostream> using


namespace std;
Int main ()
{
Int x=0; y=0; z=0;
cout <<” Input the value of X: “ ;
cin >> x;
cout <<” Input the value of Y: “ ;
cin >> y;
z = (3*x) - (4*y);
{
cout <<” Total: “ << z <<endl ;
}
If (z > = 30)
{
cout <<” True “ <<endl ;
}
else
{
cout <<” False “ <<endl ;
}
return 0;

2. Make 2 sets of array with common result of 10.

Code/Answer:
#include <iostream>
using namespace std;

int main()
{
int numbers[2];

cout << "Enter 2 numbers: " << endl;

for (int i = 0; i < 2; ++i) {


cin >> numbers[i];
}

cout << "The numbers are: ";

for (int n = 0; n < 2; ++n) {


cout << numbers[n] << " ";
}

return 0;
}

3. Time table……You will be asking to create a program that will convert a 24-hour time format to
a 12-hour time.

Code/Answer:

#include<iostream>
#include<cstdio> using
namespace std;
int main ()
{
int twenty_four_hrs; cout<<"Enter the time in
twenty four hour format:";
cin>>twenty_four_hrs;
cout<<"\n";
int hrs,min; hrs=twenty_four_hrs/100;
min=twenty_four_hrs%100;
cout<<"Time in Twelve Hour Format is:\t";
if(hrs==0&&hrs!=12)
{
hrs=12;
printf("%.2d:%.2d AM\n",hrs,min);
}
else if(hrs==12&&hrs!=0)
{
hrs=12;
printf("%.2d:%.2d PM\n",hrs,min);
}
else if(hrs<12&&hrs!=0)
{
hrs=hrs;
min=min;
printf("%.2d:%.2d AM\n",hrs,min);
}
else if(hrs>12&&hrs!=0)
{
hrs=hrs-12;
min=min;
printf("%.2d:%.2d PM\n",hrs,min);
}
}
4. How many elements that result to non-zero (So far, No answer yet)

Code/Answer:
5. How many fare if the distance is 35 km?

Code/Answer:

#include <iostream> using


namespace std;
int main()
{
int dist;
cout<<"What distance will you travel?";
cin>>dist;
if(dist<=5)
cout<<"Fare is: PHP."<<10;
else if(dist>5 && dist<10)
cout<<"Fare is: PHP."<<20;
else if(dist>=10 && dist<30)
cout<<"Fare is: PHP."<<50;
else if(dist>=30 && dist<50)
cout<<"Fare is: PHP."<<100;
else if(dist>=50 && dist<80)
cout<<"Fare is: PHP."<<150;
else if(dist>=80 && dist<=100)
cout<<"Fare is: PHP."<<250;
else
cout<<"Keep Safe";
return 0;
}
SET 2.1

Multiple Choice 1-9


Part 1
Questions and Answers

1. In an object-oriented program, data and methods are combined into one entity to keep details
of object implementation hidden from the view of users. What is this scheme.

a. Abstraction
b. Polymorphism
c. Clustering
d. Instance
e. Encapsulation

Answer: E

2. Which of the following is true about accumulators?

a. Accumulators are usually initialized to 0 (zero).


b. Accumulators are incremented by a constant value.
c. Accumulators are updated after the loop stops.
d. Accumulators are usually initialized to 1.
e. Final values of accumulators are printed at the end of the program.

Answer: a and b, a and d, b and d

3. What is the effect of the following code?

int i
int total

for i = 1 to 15
i=I+1
if I % 3 = 0
print i
end if
next

a. It prints out the integers from 3 to 15.


b. It prints out the multiples of 3 from 3 to 15.
c. It prints out the sum of the integers from 3 to 15.
d. It prints out the sum of the multiples of 3 from 3 to 15.
e. It prints out the integers from 1 to 15.

Answer: b
4. The most important reason for investigating the current systems and the needs for the new
system is to ____________.

a. become friends with the system users.


b. demonstrate progress to the project sponsor.
c. ensure that the key requirements are understood before moving into the designs
phase.
d. ensure that the requirements are understood before moving into the
implementation phase.
e. fulfill a step on the project workplan.

Answer: d

5. During programs execution the control unit continuously repeats this 3-step cycle.

a. read, run, write


b. prime, align, run
c. load, analyze, export
d. fetch, decode, execute
e. factor, cofactor, resolve

Answer: d

6. _______________ is a technique used to improve data access times rather than sorting the
data according to a key, it computes the location of the data from the key.

a. Direct Access
b. Indexed Sequential
c. File Merging
d. Hashing
e. Linked List

Answer: b

7. Given a set of numbers, A(1), A(2), … A(5), determine what the algorithm below is doing.

ALGOL: SUBROUTINE

B A (1) a. It initializes J to 1.
J 1 b. It performs comparison up
I 2 to the last element
DO WHILE ( I > 5 ) c. It determines the maximum number.
IF A (I) > B d. It locates the position of the maximum
THEN B A(I) number.
J 1 e. It initially assumes the first number
ENDIF to be the highest.
I=I+1
ENDDO
STOP Answer: b
END ALGO
8. Given the following array which loop will NOT print out the contents of the array?

String {} fruit = (“apple”, “orange”, “pear”, “pineapple”, “tomatoes”)

Answer: b

9. A sequential search algorithm is used to determine whether a given integer is stored in


an array of 1,000 integers. In each of the following cases, what is the maximum number
of array items that might be examined during a sequential search?

Case 1 - The elements are unordered.


Case 2 - The elements are sorted in ascending order.
Case 3 - The elements are sorted in descending order.

Case 1 Case 2 Case 3

a. 1, 000 1,000 1, 000


b. 1, 000 11 11
c. 1, 000 11 1, 000
d. 1, 000 500 500
e. 500 500 500

Answer: a

Program Simulation Part 2 and 3


1. Question: Given the following array of numbers and the algorithm below. Answer the
questions below. Assume that the array X(1……. n) is correctly declared and contains the
values shown.
Array 4 5 2 6 3 5 3 1
Position 1 2 3 4 5 6 7 8
Procedure M ( a, b : integer) c = c + (x [ j ] – x [ i ] )
i=i–1
c, d, i, j : integer endif

c=0 if x [ i ] < b then


d=0 x[i]–x[i]+1
i=a–1 else
j = c+ 1 x[i]–x[i]–1
while (i > j) do endif

if x ( i ) > = x ( j ) then d=d+x[j]


c = c + (x [ i ] – x [ j ] ) loop
j=j+1 end
else
What are the contents of array x after the procedure was called with M (8, 4)???

Answer:

#include <iostream> 2. Create a program that will display

using namespace std;


int main () *****
****
{ ***
* **
int i, j; *
for (i=1; i<=5; i++)
{ Answer
for (j=5; j>=i; j--)
{
cout << “ * “ ;
}
cout << "\n";
}
return 0;
}

3. Create a program that will Sum of even and odd elements available in 2 D array. (If I to
remember, parang ganyan ang tanong, its either the sum, difference, product and quotient)

Code/Answer:

#include <iostream> {
using namespace std; If(a[i] [j]%2==0)
int main ()
s1=s1+a[i] [j];
{ Else
int a [3] [3], i , j , s1=0, s2=0;
printf(“\Enter Elements”); s2=s2+a[i] [j];

for ( i = 0; i < 3; i++) }


for ( j = 0; j < 3; j++) }
scanf(%d”,&a[i] [j]); printf(“\nEven Sum = %d\nOdd
sum = %d”, s1,s2);
for ( i = 0; i < 3; i++) return 0;
{ }
for ( j = 0; j < 3; j++)

You might also like