#### Details of this Paper

##### When you use a number such as 45 in a C# program, the number is a ________.

Description

solution

Question

1. When you use a number such as 45 in a C# program, the number is a ________.;a. literal constant;b. figurative constant;c. literal variable;d. figurative variable;2. A variable declaration must contain all of the following except a(n) ________.;a. data type;b. identifier;c. assigned value;d. ending semicolon;3. Which of the following is true of variable declarations?;a. Two variables of the same type can be declared in the same statement.;b. Two variables of different types 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.;4. Assume you have two variables declared as int var1 = 3, and int var2 = 8,. Which of the following would display 838?;a. Console.WriteLine("{0}{1}{2}", var1, var2);b. Console.WriteLine("{0}{1}{0}", var1, var2);c. Console.WriteLine("{0}{1}{2}", var2, var1);d. Console.WriteLine("{0}{1}{0}", var2, var1);5. Assume you have a variable declared as int var1 = 3,. Which of the following would display X 3X?;a. Console.WriteLine("X{0}X", var1);b. Console.WriteLine("X{0,2}X", var1);c. Console.WriteLine("X{2,0}X", var1);d. Console.WriteLine("X{0}{2}", var1);6. Assume you have a variable declared as int var1 = 3,. What is the value of 22 % var1?;a. 0;b. 1;c. 7;d. 21;7. Assume you have a variable declared as int var1 = 3,. What is the value of 22 / var1?;a. 1;b. 7;c. 7.333;d. 21;8. What is the value of the expression 4 + 2 * 3?;a. 0;b. 10;c. 18;d. 36;9. Assume you have a variable declared as int var1 = 3,. If var2 = ++var1, what is the value of var2?;a. 2;b. 3;c. 4;d. 5;10. Assume you have a variable declared as int var1 = 3,. If var2 = var1++, what is the value of var2?;a. 2;b. 3;c. 4;d. 5;11. A variable that can hold the two values true and false is of type ________.;a. int;b. bool;c. char;d. double;12. Which of the following is not a C# comparison operator?;a. =>;b. !=;c. ==;d. = 7?;a. 0;b. 1;c. true;d. false;14. Which of the following C# types cannot contain floating-point numbers?;a. float;b. double;c. decimal;d. int;15. Assume you have declared a variable as double hourly = 13.00,. What will the statement Console.WriteLine(hourly), display?;a. 13;b. 13.0;c. 13.00;d. 13.000000;16. Assume you have declared a variable as double salary = 45000.00,. Which of the following will display \$45,000.00?;a. Console.WriteLine(salary.toString("c"));b. Console.WriteLine(salary.toString("c0"));c. Console.WriteLine(salary);d. two of these;17. When you perform arithmetic operations with operands of different types, such as adding an int and a float, ________.;a. C# chooses a unifying type for the result;b. you must choose a unifying type for the result;c. you must provide a cast;d. you receive an error message;18. Unicode is ________.;a. an object-oriented language;b. a subset of the C# language;c. a 16-bit coding scheme;d. another term for hexadecimal;19. Which of the following declares a variable that can hold the word computer?;a. string device = 'computer;b. string device = "computer;c. char device = 'computer;d. char device = "computer;20. Which of the following compares two string variables named string1 and string2 to determine if their contents are equal?;a. string1 = string2;b. string1 == string2;c. Equals.String(string1,string2);d. Two of the above

Paper#17715 | Written in 18-Jul-2015

Price : \$47