0% found this document useful (0 votes)
73 views7 pages

PreExam 08 07 2023 D

The document is a practice exam for an Introduction to Computer course. It contains 25 multiple choice questions testing concepts like arrays, operators, functions, classes, data types, and more. The duration of the exam is 60 minutes and no references are allowed.

Uploaded by

Viet Nguyen Tuan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views7 pages

PreExam 08 07 2023 D

The document is a practice exam for an Introduction to Computer course. It contains 25 multiple choice questions testing concepts like arrays, operators, functions, classes, data types, and more. The duration of the exam is 60 minutes and no references are allowed.

Uploaded by

Viet Nguyen Tuan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

****************, HCM CITY Fullname: . . . . . . . . . . . . . . . . . . . . . .

COMPUTER SCIENCE & ENGINEEING FACULTY ID: . . . . . . . . . . . . . . . . . . . . . . . . . . . .

PREEXAM FOR TESTING


Subject: Introduction to Computer
Duration: 60 minutes
Lecturer: L.T.Nhân
Date: *********
Exam code: 1911
This exam is close - There is no reference.

I. Choose the correct answer of each question.

1. Which of the following gives the memory ad- 5. A compiler translates


dress of the first element in array?
(a) programming code into assembly code
(a) array[6]; (b) programming code into machine code
(b) array[7]; (c) processing time into manual time
(c) array(7); (d) routine into subroutine
(d) array;

2. Which of these expressions will make the right-


most set bit zero in an input integer x? 6. Which of these expressions will return true if
the input integer v is a power of two?
(a) x = x | (x-1);
(a) (v | (v + 1)) == 0;
(b) x = x & (x-1);
(b) ( v & (v – 1)) == 0;
(c) x = x | (x+1);
(c) (v | (v – 1)) == 0;
(d) x = x & (x+2);
(d) (v & (v – 1)) == 0;
3. What is printed to the console?

7. Which of the following accesses the seventh el-


ement stored in array?
(a) array[6];
(b) array[7];
(c) array(7);
(d) array;
(a) 24
(b) 12
(c) 10
8. An interpreter translates
(d) 4
(a) A whole program into machine codes
and then, executes them
4. The concept of two functions with the same
name is known as? (b) Every single instruction in a program
into machine codes and then, executes
(a) Operator Overloading this instruction
(b) Function Overloading (c) According to a programming language,
(c) Function Overriding a or b can be correct
(d) Function renaming (d) All are correct

1
9. What is printed to the console? 13. What is printed to the console?

(a) 101
(b) 10
(c) 500
(d) None of them
(a) 2 2 6 14
(b) 14 12 12 8
(c) 8 12 12 14
10. What is printed to the console?
(d) None of them

14. Among different steps to develop a program,


which step is the most time consumed?
(a) Program specification, design and code
(b) Program design and test
(c) Program specification, document and
(a) 123 maintenance
(b) 123 12 (d) Testing, document and maintenance
(c) 123 12 1
(d) 123 12 1 0 15. How many main() function we can have in our
project?
(a) 1
(b) 2
11. During system implementation the following
are done (c) No Limit
(d) Depends on Compiler
(a) programs are written and tested with
operational data
16. What will be the output of the following C++
(b) programmers are recruited and trained code?
(c) the system is tested with operational #include <iostream>
using namespace std;
data
int fun(int=0, int = 0);
(d) All are correct int main() {
cout << fun(5);
return 0;
}
int fun(int x, int y) {
12. Concerning the Industrial 4.0, what is the name return (x+y);
of the new Internet network? }

(a) Internet of Machines (a) -5


(b) Internet of Everything (b) 10
(c) Internet of Things (c) 5
(d) Internet of People (d) 0

2
17. Most popular general-purpose programming 22. What will be the output of the following C++
languages (PL) today, such as C, C++ or Java code?
belong to:
#include <iostream>
(a) The first generation PL using namespace std;
void square (int &x, int &y) {
(b) The second generation PL x = x * --y;
}
(c) The third generation PL
int main () {
(d) The fourth generation PL int number = 30;
square(number, number);
cout << number;
18. Which of the given statements are false? return 0;
i. extern int func;
}
ii. extern int func2(int,int);
iii. int func2(int,int); (a) Compiler error!
iv. extern class foo;
(b) 30
(a) iii and iv only
(c) 870
(b) ii and iii only
(d) Run time error
(c) only iv
(d) ii, iii and iv
23. What is printed to the console?
19. What is the return values of sizeof(char) and
sizeof(int)?
(a) 1 and 4
(b) 1 and 2
(c) 1 and 8
(d) Non of them

20. What is the value of j at the end of the execu- (a) 80


tion? (b) 10
(c) 30
(d) None of them

24. What is the index number of the last element


of an array with 9 elements?
(a) 8
(b) 9
(a) 10
(c) 0
(b) 7
(d) Programmer-defined
(c) 6
(d) 4
25. Which compilation unit is responsible for
21. Which reference modifier is used to define the adding header files content to the source
reference variable? code?
(a) $ (a) Compiler
(b) # (b) Preprocessor
(c) & (c) Assembler
(d) @ (d) Linker

3
26. What is the right statement concerning the In- 29. What will be the output of the following C++
ternet of Things networks? code?
(a) Numerous devices, wireless communi- #include <stdio.h>
cations and sharing/exchanging data #include<iostream>
using namespace std;
(b) Network topology is normally stable, int array1[] = {1200, 200, 2300, 1230, 1543};
communications are based on TCP/IP int array2[] = {12, 14, 16, 18, 20};
int temp, result = 0;
architecture int main(){
for (temp = 0; temp < 5; temp++) {
(c) All are correct result += array1[temp];
}
(d) All are wrong for (temp = 0; temp < 4; temp++){
result += array2[temp];
}
cout << result;
return 0;
}

(a) 6553
(b) 6522
(c) 6533
(d) 12200
27. What are the values of n1 and n2 after the
swap() function is called?

30. What are the basic components in an moni-


toring applications based on Internet of Things
(IoTs) network?
(a) Sensors, Server
(b) Sensors, IoT Gateway, Server
(c) Computers, Router, Server, Smart-
phone apps
(d) Sensors, IoT Gateway, Server, Smart-
(a) n1 = 1, n2 = 2 phone apps
(b) n1 = 2, n2 = 1
(c) n1 = n2 = 2
(d) Non of them 31. Which of the following correctly declares an ar-
ray?
(a) int array[10];
(b) int array;
(c) array10;
(d) array array[10];

28. The most important attribute of a systems an- 32. What is the return values of sizeof(float) and
alyst is sizeof(double)
(a) excellent programming skills (a) 1 and 8
(b) very good hardware designing skills (b) 2 and 8
(c) very good technical management skills (c) 4 and 8
(d) very good writing skills (d) Non of them

4
33. Some critical issues in the Internet of Things 37. What is printed to the console?
network are:
(a) The energy sources for a huge number
of connected devices
(b) There are many wireless standards and
none of them is the best for many kinds
of IoTs applications
(c) The network topology is normally
changed due to mobility devices
(d) All of above
(a) 1234
(b) 1324
34. What is printed to the console? (c) 124
(d) None of them

38. What is the correct definition of an array?


(a) An array is a series of elements of the
same type in contiguous memory loca-
tions.
(b) An array is a series of element
(c) An array is a series of elements of
(a) 1234 the same type placed in non-contiguous
(b) 1324 memory locations
(c) 124 (d) An array is an element of the different
(d) None of them type

35. Which of the following is important in a func- 39. What is printed to the console?
tion?
(a) Return type
(b) Function name
(c) Both return type and function name
(d) The return type, function name and
parameter list

36. Which format is used to store and transmit


numbers inside a computer system?
(a) Decimal form (a) 2048
(b) Binary form (b) 8402
(c) ASCII code form (c) 22614
(d) Alphanumeric form (d) None of them

5
40. Which of the following is a correct identifier in 42. Which instruction is executed by C/C++ Pre-
C++? processor?
(a) 7var_name (a) #include<iostream>
(b) 7VARNAME (b) return 0
(c) VAR_1234 (c) void main(int argc , char ** argv)
(d) $var_name (d) None of above
41. What are the values of all elements in the array
after this program? 43. Which of the following is used for comments in
C++?
(a) // comment
(b) /* comment */
(c) both // comment or /* comment */
(d) // comment */

44. Concerning the Industrial 4.0, what is the name


of the new Internet network?
(a) 12345 (a) Internet of Machines
(b) 54321 (b) Internet of Everything
(c) 14325 (c) Internet of Things
(d) None of them (d) Internet of People

END.
Dean of Faculty/Department Lecturer

Phạm Quốc Cường Lê Trọng Nhân

6
Answer 1911
I. Choose the correct answer of each question.

1. (d) 23. (c)


2. (b) 24. (a)
3. (a) 25. (b)
4. (b) 26. (a)

5. (a) 27. (b)


6. (d) 28. (c)
7. (a) 29. (c)

8. (b) 30. (d)


9. (a) 31. (a)
10. (c) 32. (c)
11. (d) 33. (d)

12. (c) 34. (c)


13. (b) 35. (c)
14. (d) 36. (b)

15. (a) 37. (a)


16. (c) 38. (a)
17. (c) 39. (b)
18. (c) 40. (c)

19. (a) 41. (a)


20. (a) 42. (a)
21. (c) 43. (c)

22. (c) 44. (c)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy