wbauld

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Computer can execute the code in ____________. A. machine language B. assembly language C. high-level language D. none of the above

A

Every statement in C++ ends with ________, which is called a statement terminator. A. a semicolon (;) B. a comma (,) C. a period (.) D. an asterisk (*)

A

Which of the following statements is correct to display Welcome to C++ on the console? A. cout << "Welcome to C++"; B. cout >> "Welcome to C++"; C. cout < "Welcome to C++"; D. cout << 'Welcome to C++'; E. System.out.print("Welcome to C++");

A

___ is the physical aspect of the computer that can be seen. A. Hardware B. Software C.Operating System D. Application Program

A

___________ is called a stream insertion operator for sending output to the console. A. a semicolon (;) B. a comma (,) C. a period (.) D. an asterisk (*) E. <<

A

_____________ is a program that runs on a computer to manage and control a computer's activities. A. Operating system B. C++ C. Modem D. Interpreter E. Compiler

A

________ is an object-oriented programming language. A. Java B. C++ C. C D. C# E. Python

A B D E

____________ is an operating system. A. Java B. C++ C. Windows XP D. Visual Basic E. Ada

C

____________ is a device to connect a computer to a local area network (LAN). A. Regular modem B. DSL C. Cable modem D. NIC

D

A block is enclosed inside __________. A. Parentheses B. Braces C. Brackets D. Quotes

B

C++ compiler translates C++ source code into _________. A. Java code B. machine code C. C code D. another high-level language code

B

One byte has ________ bits. A. 4 B. 8 C. 12 D. 16

B

The extension name of a C++ object file on Windows is A. .java B. .obj C. .class D. .exe

B

The following program displays __________. #include <iostream> using namespace std; int main() { cout << "A"; cout << "B"; return 0; } A. A B B. AB C. B A D. BA

B

Which of the following statements is correct? A. Every line in a program must end with a semicolon. B. Every statement in a program must end with a semicolon. C. Every comment line must end with a semicolon; D. Every function must end with a semicolon; E. Every preprocessor directive must end with a semicolon;

B

Why do computers use zeros and ones? A. because combinations of zeros and ones can represent any numbers and characters. B. because digital devices have two stable states and it is natural to use one state for 0 and the other for 1. C. because binary numbers are simplest. D. because binary numbers are the bases upon which all other number systems are built.

B

_________ is the brain of a computer A. Hardware B. CPU C. Memory D. Disk

B

___________ translates high-level language program into machine language program. A. An assembler B. A compiler C. CPU D. The operating system

B

____________ are instructions to the computer. A. Hardware B. Software C. Programs D. Keyboards

B C

The main function header is written as: A. public static void main(string[] args) B. public int main(String[] args) C. int main() D. public static main(String[] args) E. public void main(String[] args)

C

If a program compiles fine, but it produces incorrect result, then the program suffers __________. A. a compilation error B. a runtime error C. a logic error

C

1.27 Programming style is important, because ______________. A. a program may not compile if it has a bad style B. good programming style can make a program run faster C. good programming style makes a program more readable D. good programming style helps reduce programming errors

C D

The speed of the CPU may be measured in __________. A. megabytes B. gigabytes C. megahertz D. gigahertz

C D

Which of the following lines is not a C++ comment? A. /** comments */ B. // comments C. -- comments D. /* comments */ E. ** comments **

C E

A preprocessor directive begins with a symbol __________. A. < B. > C. @ D. # E. *

D

Analyze the following code. I: #include <iostream> using namespace std; int main() { cout << "Welcome to C++" << endl; return 0; } II: #include <iostream> using namespace std; int main() { cout << "Welcome to C++" << endl; return 0; } A. Both I and II can compile and run and display Welcome to C++, but the code in II has a better style than I. B. Only the code in I can compile and run and display Welcome to C++. C. Only the code in II can compile and run and display Welcome to C++. D. Both I and II can compile and run and display Welcome to C++, but the code in I has a better style than II.

D

The following program displays __________. #include <iostream> using namespace std; int main() { cout << 1 + 2 << endl; return 0; } A. 1 + 2 B. 2 C. 12 D. 3 E. 1

D

Which of the following code has the best style? I: #include <iostream> using namespace std; int main() { cout << "Welcome to C++" << endl; return 0; } II: #include <iostream> using namespace std; int main() { cout << "Welcome to C++" << endl; return 0; } III: #include <iostream> using namespace std; int main() { cout << "Welcome to C++" << endl; return 0; } IV: #include <iostream> using namespace std; int main() { cout << "Welcome to C++" << endl; return 0; } A. I B. II C. III D. IV

D

Suppose you define a C++ as follows: int main() { } The source code should be stored in a file named A. Test.cpp B. Test.doc C. Test.txt D. Test.java E. Any name with extension .cpp

E

The extension name of a C++ source code file is A. .java B. .obj C. .class D. .exe E. .cpp

E


Ensembles d'études connexes

CompTIA A+ 220-1001 Printer Troubleshooting

View Set

AP2: Lab 6- Lymphatic and Immune System; Blood Typing

View Set