CIS 199 2 truths and a lie

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

Identify the false statement. a. A high-level 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. b. Each high-level programming language has its own syntax. c. Programmers use a computer program called a compiler to translate machine code into a high-level language they can understand.

c

Identify the false statement. a. A floating-point number is one in which the decimal point varies each time you reference it. b. C# supports three floating-point data types: float, double, and decimal. c. To explicitly store a constant as a float, you may place an F after the number, but to store a constant as a double you need no special designation.

a

Identify the false statement. a. If rate is 7.5 and min is 7, then the value of rate >= min is false. b. If rate is 7.5 and min is 7, then the value of rate < min is false. c. If rate is 7.5 and min is 7, then the value of rate == min is false.

a

Identify the false statement. a. In C#, an identifier must begin with an underscore, the at sign ( @ ), or an uppercase letter. b. An identifier can contain only letters, digits, underscores, and the @ sign, not special characters such as #, $, or &. c. An identifier cannot be a C# reserved keyword.

a

Identify the false statement. a. Line comments start with two forward slashes ( // ) and end with two backslashes ( \\ ). b. Block comments can extend across as many lines as needed. c. You use a namespace with a using clause, or using directive, to shorten statements when you need to repeatedly use a class from the same namespace.

a

Identify the false statement. a. Strings are information that methods need to perform their tasks. b. The WriteLine() method displays output on the screen and positions the cursor on the next line, where additional output might be displayed. c. Many methods such as WriteLine() have been created for you because the creators of C# assumed you would need them frequently.

a

Identify the false statement. a. The following is valid: int age = Convert.ToInt(ReadLine()); b. The following is valid: double payRate = Convert.ToDouble(ReadLine()); c. The following is valid: int dependents = int.Parse(ReadLine());

a

Identify the false statement. a. The value of 26 % 4 * 3 is 18. b. The value of 4 / 3 + 2 is 3. c. If price is 4 and tax is 5, then the value of price - tax++ is -1.

a

a. Assuming number and answer are legally declared variables with assigned values, then the following statement is valid: WriteLine("{1}{2}", number, answer); b. Assuming number and answer are legally declared variables with assigned values, then the following statement is valid: WriteLine("{1}{1}{0}", number, answer); c. Assuming number and answer are legally declared variables with assigned values, then the following statement is valid: WriteLine("{0}{1}{1}{0}", number, answer);

a

Identify the false statement. a. If creature1 = "dog" and creature2 = "cat", then the value of String.Equals(creature1, creature2) is false. b. If creature1 = "dog" and creature2 = "cat", then the value of String.Compare(creature1, creature2) is false. c. If creature1 = "dog" and creature2 = "cat", then the value of creature1.CompareTo(creature2) is a positive number.

b

Identify the false statement. a. If deptNum is an int with a value of 10, then the following is valid: double answer = deptNum; b. If answer is a double with a value of 10.0, then the following is valid: int deptNum = answer; c. If value is a double with a value of 12.2, then the following is valid: double answer = (int)value;

b

Identify the false statement. a. Procedural programs use variables and tasks that are grouped into methods or procedures. b. Object-oriented programming languages do not support variables or methods; instead they focus on objects. c. Object-oriented programs were first used for simulations and GUI programs.

b

Identify the false statement. a. The following is a valid and conventional C# constant declaration: const string FIRST_HEADING = "Progress Report"; b. The following is a valid and conventional C# constant declaration: const double COMMISSION_RATE; c. By default, enumeration values are integers.

b

Identify the false statement. a. After you write and save a program, you must compile it into intermediate language and then the C# just in time (JIT) compiler must translate the intermediate code into executable code. b. You can compile and execute a C# program from the command line or within the Integrated Development Environment (IDE) that comes with Visual Studio. c. Many programmers prefer to compile their programs from the command line because it provides features such as color-coded keywords and automatic statement completion.

c

Identify the false statement. a. C# supports nine integral data types, including the most basic one, int. b. Every Unicode character, including the letters of the alphabet and punctuation marks, can be represented as a number. c. When you assign a value to any numeric variable, it is optional to use commas for values in the thousands.

c

Identify the false statement. a. The C# programming language was developed as an object-oriented and component-oriented language. b. C# contains several features that make it similar to other languages such as Java and Visual Basic. c. C# contains many advanced features, so the C++ programming language was created as a simpler version of the language.

c

Identify the false statement. a. The following statement is legal in C#: char department = '5'; b. The following statement is legal in C#: char department = '\f'; c. The following statement is legal in C#: char department = '32';

c

a. A constant value cannot be changed after a program is compiled, but a variable can be changed. b. A data type describes the format and size of a data item and the types of operations that can be performed with it. c. A variable declaration requires a data type, name, and assigned value

c


Kaugnay na mga set ng pag-aaral

Exam 2 practice NETW 110 INTRO to UNIX

View Set

Chapter 5 Eukaryotic Cells and Microorganisms

View Set

5.3.11 Practice Questions Test out

View Set

Unit exam #3: 45, 47, 41, 44, 48, 49

View Set

Disseminated Intravascular Coagulation

View Set

Individual Income Tax Computation Chapter 8

View Set