Chapter 1: A First Program Using C#
1. Machine language is expressed as a series of 1s and 0s.
a. True
b. False
ANSWER: True
FEEDBACK: Correct Machine language is expressed as a series of 1s and 0s. The 1s represent
switches that are on, and the 0s represent switches that are off.
Incorrect Machine language is expressed as a series of 1s and 0s. The 1s represent
switches that are on, and the 0s represent switches that are off.
POINTS: 1
DIFFICULTY: Introductory
REFERENCES: The Programming Process
LEARNING OBJECTIVES: MSVC.FARR.25.1.1.4 - Define machine language.
KEYWORDS: Bloom's: Remember
2. C# programmers must use Pascal casing when creating method names to produce an executable program.
a. True
b. False
ANSWER: False
FEEDBACK: Correct Capitalizing the first letter of all new words in an identifier, even the first
one, as in CalculateWithholdingTax(), is a style called Pascal
casing or upper camel casing. It is legal to start a method name with a
lowercase letter, but the convention used in C# is for methods to be named
using Pascal casing. Additionally, all method names in C# are followed by a
set of parentheses.
Incorrect Capitalizing the first letter of all new words in an identifier, even the first
one, as in CalculateWithholdingTax(), is a style called Pascal
casing or upper camel casing. It is legal to start a method name with a
lowercase letter, but the convention used in C# is for methods to be named
using Pascal casing. Additionally, all method names in C# are followed by a
set of parentheses.
POINTS: 1
DIFFICULTY: Introductory
REFERENCES: Procedural and Object-Oriented Programming
LEARNING OBJECTIVES: MSVC.FARR.25.1.2.3 - Define method.
KEYWORDS: Bloom's: Remember
3. The C# programming language was developed as an object-oriented and component-oriented language.
a. True
b. False
ANSWER: True
FEEDBACK: Correct The C# programming language was developed as an object-oriented and
component-oriented language. It is part of Microsoft Visual Studio, a package
designed for developing applications that run on Windows computers. Unlike other
Page 1
,Name: Class: Date:
Chapter 1: A First Program Using C#
programming languages, C# allows every piece of data to be treated as an object
and to consistently employ the principles of object-oriented programming. C#
provides constructs for creating components with properties, methods, and events,
making it an ideal language for modern programming, where building small,
reusable components is more important than building huge, stand-alone
applications.
Incorrect The C# programming language was developed as an object-oriented and
component-oriented language. It is part of Microsoft Visual Studio, a package
designed for developing applications that run on Windows computers. Unlike other
programming languages, C# allows every piece of data to be treated as an object
and to consistently employ the principles of object-oriented programming. C#
provides constructs for creating components with properties, methods, and events,
making it an ideal language for modern programming, where building small,
reusable components is more important than building huge, stand-alone
applications.
POINTS: 1
DIFFICULTY: Introductory
REFERENCES: The C# Programming Language
LEARNING OBJECTIVES: MSVC.FARR.25.1.4.1 - Describe some features of the C# programming language.
KEYWORDS: Bloom's: Understand
4. When the keyword void is used in the Main() method header, it indicates that the Main() method is
empty.
a. True
b. False
ANSWER: False
FEEDBACK: Correct When the keyword void is used in the Main() method header, it does not
indicate that the Main() method is empty or that it has no effect, but rather
that the method does not return any value when called.
Incorrect When the keyword void is used in the Main() method header, it does not
indicate that the Main() method is empty or that it has no effect, but rather
that the method does not return any value when called.
POINTS: 1
DIFFICULTY: Introductory
REFERENCES: Writing a C# Program that Produces Output
LEARNING OBJECTIVES: MSVC.FARR.25.1.5.1 - Define the parts of a typical C# output statement.
KEYWORDS: Bloom's: Understand
5. The Visual Studio IDE provides programmers with advanced features such as syntax coloring and automatic
statement completion.
a. True
b. False
ANSWER: True
FEEDBACK: Correct The Integrated Development Environment (IDE) is a programming
environment that allows you to issue commands by selecting choices from
Page 2
,Name: Class: Date:
Chapter 1: A First Program Using C#
menus and clicking buttons. The IDE operates more like other software you
may have used, such as a word-processing program or spreadsheet. The IDE
provides automatic statement completion. For example, if you type u, then a
list of choices including using is displayed and you can click using
instead of typing it. The code is displayed in color so that you can more
easily identify parts of your program. As examples, one color is used for
C#-reserved words and a different color is used for literal strings.
Incorrect The Integrated Development Environment (IDE) is a programming
environment that allows you to issue commands by selecting choices from
menus and clicking buttons. The IDE operates more like other software you
may have used, such as a word-processing program or spreadsheet. The IDE
provides automatic statement completion. For example, if you type u, then a
list of choices including using is displayed and you can click using
instead of typing it. The code is displayed in color so that you can more
easily identify parts of your program. As examples, one color is used for
C#-reserved words and a different color is used for literal strings.
POINTS: 1
DIFFICULTY: Introductory
REFERENCES: Compiling and Executing a C# Program Using Visual Studio
LEARNING OBJECTIVES: MSVC.FARR.25.1.10.1 - Describe the advantages of compiling a C# program within the
IDE as opposed to from the command line.
KEYWORDS: Bloom's: Understand
6. Internally, computers are constructed from circuitry that consists of small on/off switches. What is the most
basic circuitry-level language that computers use to control the operation of those switches called?
a. syntax
b. machine language
c. a compiler
d. a program
ANSWER: b
FEEDBACK: a. Incorrect. The most basic circuitry-level software that computers use to control
the operation of their small on/off switches is called machine language. Machine
language is expressed as a series of 1s and 0s. The 1s represent switches that
are on, and the 0s represent switches that are off. Syntax is the rules of a high-
level language. Each high-level language has its own syntax.
b. Correct. The most basic circuitry-level software that computers use to control the
operation of their small on/off switches is called machine language. Machine
language is expressed as a series of 1s and 0s. The 1s represent switches that
are on, and the 0s represent switches that are off.
c. Incorrect. The most basic circuitry-level software that computers use to control
the operation of their small on/off switches is called machine language. Machine
language is expressed as a series of 1s and 0s. The 1s represent switches that
are on, and the 0s represent switches that are off. A compiler translates high-
level language statements into machine code.
d. Incorrect. The most basic circuitry-level software that computers use to control
the operation of their small on/off switches is called machine language. Machine
Page 3
, Name: Class: Date:
Chapter 1: A First Program Using C#
language is expressed as a series of 1s and 0s. The 1s represent switches that
are on, and the 0s represent switches that are off. A computer program is a set of
instructions (in a programming language) that tells a computer what to do.
Programs are also called software.
POINTS: 1
DIFFICULTY: Introductory
REFERENCES: The Programming Process
LEARNING OBJECTIVES: MSVC.FARR.25.1.1.4 - Define machine language.
KEYWORDS: Bloom's: Remember
7. What kind of programming language allows you to use a vocabulary of reasonable terms such as "read,"
"write," or "add" instead of the sequence of on/off switches that perform these tasks?
a. high-level programming language
b. machine language
c. low-level programming language
d. assembly language
ANSWER: a
FEEDBACK: a. Correct. A high-level programming language allows you to use a limited
vocabulary of reasonable keywords. High-level language programs contain
keywords such as read, write, and add that you use instead of the sequence of
on/off switches that perform these tasks. High-level languages also allow you to
assign reasonable names to areas of computer memory.
b. Incorrect. A high-level programming language allows you to use a limited
vocabulary of reasonable keywords. Keywords are predefined and
reserved identifiers that have special meaning in a language. High-level
language programs contain keywords such as read, write, and add that you
use instead of the sequence of on/off switches that perform these tasks.
Machine language, in contrast, is expressed as a series of 1s and 0s. The 1s
represent switches that are on, and the 0s represent switches that are off.
c. Incorrect. A high-level programming language allows you to use a limited
vocabulary of reasonable keywords. Keywords are predefined and
reserved identifiers that have special meaning in a language. High-level
language programs contain keywords such as read, write, and add that you
use instead of the sequence of on/off switches that perform these tasks. In
contrast, a low-level programming language, such as assembly language,
is only a small step above the representation of computer instructions as a
series of 1s and 0s.
d. Incorrect. A high-level programming language allows you to use a limited
vocabulary of reasonable keywords. Keywords are predefined and
reserved identifiers that have special meaning in a language. High-level
language programs contain keywords such as read, write, and add that you
use instead of the sequence of on/off switches that perform these tasks.
Assembly language falls between machine language and high-level
languages, as it is written using human-readable codes, but consists of
instructions that much more closely mirror the steps taken by the computer
Page 4