wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Final Exam - BECC0302

Total questions: 35

Worksheet time: 48mins

Name
Class
Date
1.

What is the full name of your instructor in BECC0302?

(a)  

2.

Definition of programming language.

a)

A language used by machines to communicate with aliens.

b)

A language used by humans to communicate with machines.

c)

A language used to operate a machine.

d)

A language used to create a machine.

3.

IDE stands for?

(a)  

4.

The output or print function used in C++.

(a)  

5.

The input function used in C++.

(a)  

6.

Terminator symbol used in C++.

(a)  

7.

Complete this statement to display the text.

cout ____ "Level Completed!";

a)

<<

b)

++

c)

>>

d)

( )

8.

An allocated storage in a programming language that stores values like text and numbers.

a)

variable

b)

constant

c)

variety

d)

data type

9.

Which of the following options has a correct variable name?

a)

employeeName

b)

34empName

c)

$empname

d)

employee ID

10.

A variable's value cannot change during the execution of the program.

a)

True

b)

False

11.

What is the output of this code?

string x = "a";

x = "b";

cout << x;

x = "c";

cout << x;

a)

bc

b)

abc

c)

cb

d)

ab

12.

Integer is a data type used to store numbers with decimal points.

a)

True

b)

False

13.

Double data type is precise compared to float.

a)

True

b)

False

14.

This data type is used to store variable character sequence.

(a)  

15.

Boolean has only two values: true and false. In which of the following does this two values corresponds to when we execute a program containing a boolean?

a)

1 and 0

b)

True and False

c)

Yes and No

d)

Nothing corresponds to the values.

16.

What is the output of this code?

int x = 4;

int y = 2;

int z = 1;

cout << x+y+z+x;

(a)  

17.

What would be the output of this code?

int price = 78, discount = 15;

int total = price - discount;

cout << total;

a)

63

b)

65

c)

66

d)

60

18.

Complete the given code snippet to be able to compute for the area.

double length, width;

cin >> length;

cin >> width;

double area = (a)   ;

cout << area;

19.

When separating multiple variable declarations with a comma, they need to . . . ?

a)

have the same type

b)

be integers

c)

be named x and y

d)

have the same value

20.

What is the value of the variable based on the code snippet?

auto percentage = 3.1415;

cout << "Your daily increase is " << percentage;

a)

double

b)

integer

c)

string

d)

void

21.

Is this code valid?

auto name;

name = "Jose Carlo";

a)

Yes, because there is a proper variable declaration.

b)

No, because the auto keyword assigns data type based on initialized value.

c)

Yes, because the statements both have terminator symbols.

d)

No, because 'Jose Carlo' is not a proper name.

22.

Do you think the given code snippet will have a proper result or not?

string studentName;

cin >> studentname;

cout << "Welcome, " << studentName << "!" << endl;

a)

Yes, it will yield a proper result.

b)

Yes, but the input function will not execute.

c)

No, because there's no value initialized.

d)

No, because the variable call is not the same with the declaration.

23.

int average = 86;

if(average >= 75 && average <= 89)

cout << "You passed the exams!";

Is the condition true of false?

a)

True

b)

False

24.

int num = 12;

if(num != 12)

cout << "Wrong number!";

Is the condition true or false?

a)

True

b)

False

25.

for(int a=1; a<6; a++)

cout << a << endl;

What will be the output of the code?

a)

1

2

3

4

5

b)

1

3

5

7

9

c)

6

d)

12345

26.

for(int a=1; a<=10; a++)

int b = a % 2;

if(b != 1)

cout << a << endl;

What will be the output of the code?

a)

2

4

6

8

10

b)

1

3

5

7

9

c)

1

2

3

4

5

d)

10

9

8

7

6

27.

int a = 5;

while(a > 0)

cout << a << endl;

a--;

What will be last result after executing this code?

a)

1

b)

2

c)

4

d)

5

28.

int num = 0;

do

cout << num << endl;

num+=2;

while(num <= 10);

What is the fourth output after executing this code?

a)

2

b)

4

c)

5

d)

6

29.

Array is a collection of values assigned under one name.

a)

True

b)

False

30.

int num[5] = {12, 13, 41, 51, 26};

cout << num[2] + num[0];

What will be the output of the code?

(a)  

31.

int age[] = {24, 23, 26, 25, 24, 28};

age[1]++;

cout << age[0] + age[5];

What wil be the output of the given code?

(a)  

32.

string names[] = {"Carlo", "Jemuel", "Greg", "Miles", "Olivia", "Jerard"};

cout << names[3];

Change the value 'Olivia' to 'Oliver'. Write your answer/ code.

(a)  

33.

What will be the output of this code?

(a)  

34.

What will be the output of this code?

(a)  

35.

int arr[] = {1, 2, 3, 4, 5};

int *ptr = arr;

arr[2] is the same as . . .

a)

*(ptr+2)

b)

ptr+2

c)

*ptr+2

d)

*ptr[2]