C# - Ch. 2 Quiz

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

T

(T/F) An escape sequence is used to represent special characters such as a carriage return or a tab, and always begins with a backslash.

F

(T/F) Operator precedence rules ensure that addition and subtraction always take place prior to multiplication, division, or remainder in an expression.

T

(T/F) The equal sign (=) is the C# assignment operator.

T

(T/F) You can concatenate two strings with the plus (+) sign.

F

(T/F) someValue++ is an example of the use of the prefix increment operator.

a

An assignment that is made when a variable is declared is known as what? a) An initialization of the variable b) An allocation of the variable c) An assignment to the variable d) A definition of the variable

D

How is a Boolean variable declared in a program? a) An int type variable must be declared, followed by the bool value. b) A boolean type variable must be declared, followed by the bool value. c) A char type variable must be declared, followed by the bool value. d) A bool type variable must be declared, followed by the bool value.

A

In C#, += adds the operand on the right to the operand on the left and assigns it to the operand on the left in one step. What is the name for this operator? a) add and assign b) postfix increment c) increment and assign d) prefix increment

D

In the C# statement moneyString = someMoney.ToString("F3"), what is "F3" an example of? a) literal constant b) intrinsic type c) named constant d) standard numeric format string

B

What can be used to control the appearance of text output? a) A declared namespace b) A defined format string c) A set placeholder d) Carefully placed whitespace

B

What data type can be used to hold a series of characters? a) int b) string c) sbyte d) char

C

What data type can be used to hold any single character, including numbers and non-printing characters? a) string b) bool c) char d) int

A

What happens when "string1" is added to "string2" using the + sign in the C# programming language? a) The strings are concatenated together. b) The result is returned as a boolean integer. c) The strings are converted to integer equivalents and then added together. d) A type error occurs, and the program is halted.

A

What is NOT part of a variable declaration in the C# programming language? a) The variable's associated parent class. b) The data type the variable will store. c) The variable's name. d) An optional assignment operator and assigned value.

a

What is the term for a named location in computer memory that can hold different values at different points in time? a) variable b) alias c) literal constant d) constant

C

What keyword can be used to create a named identifier for a memory location whose contents cannot change? a) fix b) final c) const d) static

C

What method can be used as an alternative to the Convert class methods to change a string into a number? a) Cast() b) Write() c) Parse() d) Assign()

A

What method can be used to accept user input from the keyboard on the console? a) ReadLine() b) Next() c) NextLine() d) Input()

A

What method from the Convert class can be used to convert a specified value to an 8-bit unsigned integer? a) ToByte() b) ToInt16() c) ToSingle() d) ToDecimal()

C

What operator is used for exponentials in the C# programming language? a) % b) * c) None of the above. d) ^

C

What statement regarding operator precedence is accurate? a) Operations are always evaluated left to right, regardless of the expressions. b) Multiplication, division, and addition always take place prior to the calculation of a remainder. c) Operations that are placed in parentheses are evaluated first. d) Addition and subtraction operations are evaluated first.

A

What type of arithmetic operator has one argument to the left and another argument to the right of the operator? a) binary b) unary c) composite d) complex

C

What type of expression has a Boolean value as a result? a) decrement b) assignment c) comparison d) unifying

D

What type of number can be described as having varying numbers of significant digits, which contains decimal positions? a) whole b) integer c) int d) floating-point

B

What type of operator can be used to reduce a variable's value by 1 either at time of evaluation, or after it is evaluated, depending on placement? a) sub and assign operator b) decrement operator c) add and assign operator d) increment operator

D

What type of program specifically allows and accepts user input? a) constant program b) procedural program c) static program d) interactive program

A

What uses curly braces containing a number that indicates the desired position for a variable in a list that follows a string used for formatting purposes? a) placeholder b) namespace c) format string d) whitespace

D

When running a program, an instruction to the user to enter data for the program to process is known by what term? a) cue b) line c) hint d) prompt

D

When using arithmetic operations with operands of dissimilar types, an automatic conversion of nonconforming operands to a unifying type occurs. What is this conversion process called? a) level cast b) manual cast c) explicit cast d) implicit cast

A

You are performing an arithmetic operation and have placed the desired result type in parentheses followed by a variable to be cast with the result. What is this an example of? a) explicit casting b) implicit casting c) automatic casting d) intrinsic casting


Kaugnay na mga set ng pag-aaral

Advanced Network Administration Using Microsoft Windows Server: Final Exam

View Set

Exception Handling, Java collection 1.

View Set

Chapter 1: Contract Law Overview

View Set

EAQ 4- Comfort, Pain & Nutrition

View Set

MGT 370 Midterm Chapter 1,2,3,4,5 and 6

View Set

Real Estate Pre-License Uniform Quiz 3

View Set