MC Flashcards
(154 cards)
Programming languages such as C#, Java, and Visual Basic are ______________ languages.
a. machine
b. high-level
c. low-level
d. uninterpreted
Correct Answer: b. high-level
A program that translates high-level programs into intermediate or machine code is a(n) ______________ .
a. mangler
b. compactor
c. analyst
d. compiler
Correct Answer: d. compiler
The grammar and spelling rules of a programming language constitute its _____________ .
a. logic
b. variables
c. class
d. syntax
Correct Answer: d. syntax
Variables are _______________ .
a. named memory locations
b. unexpected results
c. grammar rules
d. operations
Correct Answer: a. named memory locations
Programs in which you create and use objects that have attributes similar to their real-world counterparts are known as ______________ programs.
a. procedural
b. logical
c. object-oriented
d. authentic
Correct Answer: c. object-oriented
Which of the following pairs is an example of a class and an object, in that order?
a. University and Yale
b. Chair and desk
c. Clydesdale and horse
d. Maple and tree
Correct Answer: a. University and Yale
The technique of packaging an object’s attributes into a cohesive unit that can be used as an undivided entity is ______________ .
a. inheritance
b. encapsulation
c. polymorphism
d. interfacing
Correct Answer: b. encapsulation
Which of the following languages is least similar to C#?
a. Java
b. Visual Basic
c. C++
d. machine language
Correct Answer: d. machine language
A series of characters that appears within double quotation marks is a(n) ______________ .
a. method
b. interface
c. argument
d. literal string
Correct Answer: d. literal string
The C# method that produces a line of output on the screen and then positions the cursor on the next line is ________________ .
a. WriteLine()
b. PrintLine()
c. DisplayLine()
d. OutLine()
Correct Answer: a. WriteLine()
Which of the following is a class?
a. System
b. Console
c. void
d. WriteLine()
Correct Answer: b. Console
In C#, a container that groups similar classes is a(n) ___________________ .
a. superclass
b. method
c. namespace
d. identifier
Correct Answer: c. namespace
Every method in C# contains a _________________________ .
a. header and a body
b. header and a footer
c. variable and a class
d. class and an object
Correct Answer: a. header and a body
Which of the following is a method?
a. namespace
b. class
c. Main()
d. static
Correct Answer: c. Main()
In C#, an identifier _________________________ .
a. must begin with an underscore
b. can contain digits
c. must be no more than 16 characters
d. can contain only lowercase letters
Correct Answer: b. can contain digits
Which of the following identifiers is not legal in C#?
a. per cent increase
b. annualReview
c. HTML
d. alternativetaxcredit
Correct Answer: a. per cent increase
The text of a program you write is called _________________________.
a. object code
b. source code
c. machine language
d. executable documentation
Correct Answer: b. source code
Programming errors such as using incorrect punctuation or misspelling words are collectively known as ____________________ errors.
a. syntax
b. logical
c. executable
d. fatal
Correct Answer: a. syntax
A comment in the form / this is a comment / is a(n)___.
a. XML comment
b. block comment
c. executable comment
d. line comment
Correct Answer: b. block comment
If a programmer inserts using static System.Console; at the top of a C# program, which of the following can the programmer use as an alternative to System.Console.WriteLine(“Hello”);?
a. System(“Hello”);
b. WriteLine(“Hello”);
c. Console.WriteLine(“Hello”);
d. Console(“Hello”);
Correct Answer: b. WriteLine(“Hello”);
When you use a number such as 45 in a C# program, the number is a ______________.
a. figurative constant
b. literal constant
c. literal variable
d. figurative variable
Correct Answer: b. literal constant
A variable declaration must contain all of the following except a(n) ______________.
a. data type
b. identifier
c. assigned value
d. ending semicolon
Correct Answer: c. assigned value
Which of the following is true of variable declarations?
a. Two variables of different types can be declared in the same statement.
b. Two variables of the same type can be declared in the same statement.
c. Two variables of the same type must be declared in the same statement.
d. Two variables of the same type cannot coexist in a program.
Correct Answer: b. Two variables of the same type can be declared in the same statement.
Assume that you have two variables declared as int var1 = 3; and int var2 = 8;. Which of the following would display 838?
a. WriteLine(“{0}{1}{2}”, var1, var2);
b. WriteLine(“{0}{1}{0}”, var2, var1);
c. WriteLine(“{0}{1}{2}”, var2, var1);
d. WriteLine(“{0}{1}{0}”, var1, var2);
Correct Answer: b. WriteLine(“{0}{1}{0}”, var2, var1);