Final Review (IT Questions Only)

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

A project librarian maintains which of the following for an IT project? (Check all that apply.) -operating system -program source code -online libraries -documents -test materials

A project librarian maintains: -program source code -online libraries -documents -test materials Notes: **"Operating system" does not apply because the operating system of an IT application will be maintained by a system engineer or programmer.

Which protocol is used for network management? -HTTP -SMTP -SNMP -TCP -IP

SNMP is used for network management

What is a tuple? -a data type -an attribute -a column -a row

A tuple is a row.

Which of the following statements or expressions allow a Java program to access the length of array A? a. A = length(); b. A.length = int A[]; c. int A[] = { 1, 2, 3, 4, 5}; d. A.length

A.length

Message headers contain which of the following? (Check all that apply.) a. payload b. error checking information c. preamble d. message size e. source and destination address

Message headers contain: -message size -source and destination address

Assuming the following statements have been executed, what is stored in answer? double i = 7; int n = 2; double answer; answer = i/n; a. 3 b. 3.5 c. 0.2857 d. 5 e. 14

answer = 3.5 Explanation: since the double variable, i, precedes the other, the int, n, is automatically promoted into a double.

What will this print? int a=5, b=10, sum=0; if ((++a==5)||(++b==10)) { sum=a+b; } System.out.println(a + ", " + b + ", " + sum);

6, 11, 0

What will this print? if ((++a==5)||(b++==10)) { sum=a+b; } System.out.println(a + ", " + b + ", " + sum);

6, 11, 17

A protocol data unit (PDU) contains which of the following? (Check all that apply.) -header -digital signature -payload -MDU -trailer

A PDU can be broken into three parts: -a header -a payload -a trailer (optional)

Which of the following are a leading RDBMS today? (Check all that apply.) -VB -MySQL -MS Excel Macros -Sybase -UDB

MySQL, Sybase, UDB are all leading RDBMS. VB is a programming language. Excel is a spreadsheet application.

Given the following recursive method: public static int doSum(int n) { if (n <= 0) return 0; else return 1 + doSum(n - 1); What is the value of the expression doSum(5)? a. 0 b. 10 c. 15 d. 5

d. 5 5 > 0 so return 1 + doSum(5-1... which equals 4) 4 > 0 so return 1 + doSum(4-1... which equals 3) 3 > 0 so return 1 + doSum(3-1... which equals 2) 2 > 0 so return 1 + doSum(2-1... which equals 1) 1 > 0 so return 1 + doSum(1-1... which equals 0) 0 meets base case 1 + 1 + 1 + 1 + 1 = 5

Which of the following Java statements correctly declares a constant? -constant MORTGAGE_RATE = 3.5; -constant mRATE = 3.5; -double mORTGAGE_RATE = 3.5; -final double MRATE = 3.5;

-final double MRATE = 3.5; (this correctly declares a constant)

Given the array: int[] values = {0, 1, 2, 3, 4}; What is the value of the expression below? values[1] + values[2]? a. 3 b. 1 c. 5 d. 7

int[] values = {0, 1, 2, 3, 4}; values[1] + values[2] = 3

What is the outcome of the following code? int a = 5, b = 10, sum = 0; if ((a++ == 5) && (b++ == 10)) { sum = a + b; } System.out.println(a + "," + b + "," + sum); a. 5, 10, 0 b. 6, 11, 17 c. 5, 10, 15 d. 5, 10, 17

b. 6, 11, 17

Please select all of the properties of recursion as used in computer programming from the list below. a.The execution of a recursive procedure is governed by the evaluation of a conditional clause. b. Recursion is a type of repetitious procedure. c. Recursion is composed entirely of arithmetic procedures. d. Recursion is a programming procedure which is capable of calling itself.

(a), (b), and (d) are correct. In fact, (d) is actually part of the definition of recursion (c) is incorrect because recursion is NOT composed entirely of arithmetic procedures. The reason for this is that recursion is founded on the requirement to evaluate the base condition, which performs no arithmetic (e.g. i == 5) Notes: **The execution of a recursive procedure is governed by the evaluation of a conditional clause, and the conditional clause is called the base condition. Recursion is a type of repetitious procedure.

What is the index of the first element of an array in Java? a. 0 b. 1.0 c. First d. 1

0 is the index of the first element in an array in Java

What will this print? int a=5, b=10, sum=0; if ((++a==5)&&(b++==10)) { sum=a+b; } System.out.println(a + ", " + b + ", " + sum);

6, 10, 0

What will this print? int a=5, b=10, sum=0; if ((a++==5)&&(++b==10)) { sum=a+b; } System.out.println(a + ", " + b + ", " + sum);

6, 11, 0

Which of the following statements indicate some aspect of the definition of an array in Java? (Check all that apply.) a. The array definition may not actually create the array. b.The name of the reference variable for an array may be followed by a pair of square brackets and an equal sign. c.The definition of an array may also include specific values to be stored in elements of the array. d. The array itself will exist in the Heap.

ALL of the statements are correct **Note: If the size of the array is not know until execution time i.e. the user inputs a number equal to the number of elements desired you might see statements such as int size = np.nextInt(); int a[] = new int[size];

What does a Java class definition contain? (Select all that are true.) -computation methods -constructors -instance variables -get and set methods

All of the above Notes: ** Class definitions contain definitions of: instance variables, constructors, get and set methods, and computation methods.

Which of the following are true about a software program? (Check all that apply.) a. A program is responsible for validating user inputs b. A program consists of instructions that can be executed in any order c. A program consists of instructions that must be executed in a particular sequence d. A program consists of instructions that accomplish a specific operation e. A set of program instructions is known as an algorithm

Among all the answer choices, ALL are true EXCEPT for: b. a program consists of instructions that can be executed in any order Notes: **A program consists of instructions that have specific functions and must be executed in a particular sequence or order. These instructions are collectively known as an algorithm.

Client-based architectures do which of the following? (Check all that apply.) a. put data storage logic on one computer and all other logic on another b. are ones where each machine is both a client and a server c. evenly distribute processing on two systems d. run timesharing e. run multitier applications

Among the answer choices, client-based architectures only: a. put data storage logic on one computer and all other logic on another Wrong answers: Choice (b) only applies to P2P networks Choice (c) applies to client-server and P2P, not client-based Choice (d) applies to host-based Choice (e) host-based only has 2 entities so no multi-tier appps

Which of the following languages is interpretive? -jGRASP -Java -BASIC -C++

Among these answer choices, only BASIC is interpretive. (a) is wrong-- jGrasp is an IDE like Eclipse, not a language (b) is wrong-- byte codes are interpreted though Java is compiled (d) is wrong because C++ is a compiled language

How are instance variables hidden within an object so that they cannot be referenced from outside the object? a. They are declared as private b. They are named using special identifiers c. They are not given specific values d.They are not declared

Answer: a. They are declared as private

When an object is created, the actual variables associated with the object are called a. fixed variables b. class instances c. instance variables d. instance methods

Answer: c. instance variables **Fields within an object are known as instance fields.

The private keyword when used as an access modifier for an instance variable a. Allows the variable to be accessed from other classes b. Defines a primitive data type c. Ensures that the variable is only accessed from private methods d. Ensures that the variable is only accessible from within the class e. Is used to define a constant

Answer: d. Ensures that the variable is only accessible from within the class Notes: **The private keyword is an access modifier which enforces that the value of this variable is only accessible from within the class and not from outside the class.

What will be printed by the following Java program? public class Song public static void main (String [] args) { for (int i=1; i<3; i++) { System.out.print ("Row "); } System.out.print (i); System.out.print (" Your Boat"); } Answers: a. Row Row 2 Your Boat b. Row Row 3 Your Boat c. 1 Your Boat d. This program would not compile

Answer: d. This program would not compile Note: **the reason it won't compile is that the main method isn't enclosed by curly brackets. Always check syntax first. However, if curly brackets were correctly placed, the answer would be (b): Run 1: i=1 1 < 3 (conditional clause) -TRUE Row END BLOCK i=1+1=2 Run 2: i=2 2 < 3 (conditional clause)-TRUE Row END BLOCK i=2+1=3 Run 3 i=3 3 < 3 (conditional clause) -FALSE END BLOCK Row Row 3 Your Boat

Once an object is created, which of the following best describes how a programmer invokes a method defined within that object? a. By specifying the constructor and the method name b. By specifying the names of public attributes and the method name c. By using the class name from which the object was instantiated and the method name d. By specifying the method name directly e. By using the reference variable returned by the new operator and the method name

Answer: e. By using the reference variable returned by the new operator and the method name Notes: **An object is created by using the "new" operator. This operator will return a reference to the object which should then be stored in a reference variable. There after the object is reference by specifying the reference variable.

Select all statements or expressions that would allow a Java program to display the length of array Infant_Age, as defined as follows: int Infant_Age[] = {1, 2, 3, 4} (Check all that apply.) a. System.out.print (length.Infant_Age) b. System.out.print (Infant_Age[4]) c. for (int i=0; i<4; i++) {System.out.print (i)} d. System.out.print (Infant_Age.length)

Answer: d. System.out.print (Infant_Age.length) (a) is wrong because the object name (i.e. Infant_Age) should precede the method (b) is tricky. Infant_Age.length DOES equal 4. However, in the array, there is no value in Infant_Age[4] since there is no fifth value (c) is also tricky. Again, Infant_Age.length = 4 (i.e. four values in array). If the print statement was OUTSIDE the brackets, the value would be 4. However, since i is incremented AFTER the block, the last number to print is 3.

Which of the following statements are true regarding arrays in Java? (Check all that apply.) a. An array is specified by putting a pair of square brackets following a variable name. b.An array is a collection of variables which are accessed individually by using the name of its reference variable and an index. c. An array is a collection of variables which all share the same name. d. An array is collection of primitive variables.

Answers: (b) (c) - the reference variable is the name of all the array's variables (a) is wrong because writing—int [ ] a;— only declares the reference variable. It does not actually define an array. (only 2 ways to define an array... both need the 'new' operator to create the object) (d) is incorrect because arrays can contain String (which are derivative)

Which of the following are true about Java classes? (Select all that apply.) a. A class is a blueprint of the description of an object b. A program can only have one class c. Classes define methods and attributes d. All the attributes in a class have specific values stored in them e. Classes are created from objects

Answers: a. A class is a blueprint of the description of an object c. Classes define methods and attributes

Choose all of the following that are true about constructors. a. A constructor is a method with the same name as the class b. You must always define a constructor for every class c. There can be many constructors defined within a single class d. If you don't define a constructor no constructor will be executed when you create an object e. Constructors are very often used to initialize instance variables

Answers: a. A constructor is a method with the same name as the class c. There can be many constructors defined within a single class e. Constructors are very often used to initialize instance variables Notes: **Constructors have the same name as the class and there can be many of them defined within a single class. Constructors executed when an object of the class is created and are often used to initialize instance variables. If you do not define a constructor the default constructor is executed.

Private instances variables within an object can have their values established by which means? (Select all that are true.) a. By code from within the object b. By mutator methods c. By code in a constructor d. Directly by referencing the variable from code outside of the object e. By accessor methods

Answers: a. By code from within the object b. By mutator methods c. By code in a constructor

Assuming that an instance variable is declared as private which of the following techniques can be used to change its value? (Select all that apply.) a. Have a method within the object change its value b. Pass a value via the constructor which will store it in the variable c. Invoke an accessor method d. Reference it directly by name e. Invoke a mutator method

Answers: a. Have a method within the object change its value b. Pass a value via the constructor which will store it in the variable e. Invoke a mutator method **Private instance variables can be changed via a constructor, mutator method, or any other method within the object.

Which of the following are disadvantages of procedural programming? (Select all that apply.) a. If the data type of data is changed, all procedures that reference that data must also be changed b. Procedures have clearly defined inputs and outputs c. Data can only be accessed by one procedure d. If data becomes corrupted, it is difficult to determine what code corrupted the date e. It is difficult to share or reuse procedures

Answers: a. If the data type of data is changed, all procedures that reference that data must also be changed d. If data becomes corrupted, it is difficult to determine what code corrupted the date e. It is difficult to share or reuse procedures Notes: **If a data type was changed, or the structure of the data changed, all the procedures that operated on that data would have to be changed. Also, if data became corrupted it was difficult to determine "who" (what procedure) might have done it. Since data was separate from procedures it was very difficult to share or reuse procedures in different programs.

Choose all of the following that are true about what happens when an object is created. a. Instance variables are initialized b. A method with the same name as the class is sometimes executed within the object c. A reference to the object is returned d. The toString method is executed e. A constructor is executed

Answers: a. Instance variables are initialized b. A method with the same name as the class is sometimes executed within the object c. A reference to the object is returned e. A constructor is executed Notes: **When an object is created either the default constructor or a constructor defined within the class is executed. Instance variables are initialized and a reference to the object is returned.

Which of the following are true about a child class in an inheritance relationship? (Select all that apply.) a. The parent class contains all attributes and methods that are in common among all child classes b. The parent includes all the attributes and methods of the child c. There is a relationship between all the children d. The child class, rather than the parent, is instantiated e. There is a relationship between the child and the parent

Answers: a. The parent class contains all attributes and methods that are in common among all child classes d. The child class, rather than the parent, is instantiated e. There is a relationship between the child and the parent Notes: **The child is related to the parent and includes all the attributes and methods of the parent. Objects are created from the child class, not the parent. The role of the parent is to contain all the definitions of attributes and methods that are common to all the child classes.

Which of the following are true about the procedural programming paradigm? (Select all that apply.) a. Data resides in procedures b. Data is centralized c. Data is separate from the code that processes it d. Objects are used e. Programs are comprised of a series of procedures

Answers: b. Data is centralized c. Data is separate from the code that processes it e. Programs are comprised of a series of procedures Notes: **In procedural programming paradigm all data was centralized, programs were comprised of a series of procedures (also called subprograms or functions), and the data was passed back and forth for processing among the procedures. Data was separate from the code that processed that data.

Which of the following are true about java objects? (Select all that apply.) a. Only one object can be instantiated from a given class b. Objects are instantiated from classes c. The attributes in an object contain specific values d. Once attributes in an object are initialized all methods within that object have access to that data e. Objects only contain methods

Answers: b. Objects are instantiated from classes c. The attributes in an object contain specific values d. Once attributes in an object are initialized all methods within that object have access to that data Notes: **An object is instantiated from a class. Objects contain both data (attributes) and procedures (methods). When the object is instantiated an initial values of attributes will most likely be specified and stored in the object. Thereafter, any of the methods within the object may be invoked and have access to these attributes It is possible to have many objects, all derived from the same class.

Choose all that are true about class inheritance. a. A class may only add methods to what was inherited from the base class b. The keyword used to indicate inheritance is extends c. Objects are always created from the base class d. The keyword used to indicate inheritance is implements e. Multiple classes share characteristics from a base class

Answers: b. The keyword used to indicate inheritance is extends c. Objects are always created from the base class e. Multiple classes share characteristics from a base class >In addition to what is inherited, both attributes and methods can be added to the derived class, not just methods Notes: **Whenever there are common characteristic among multiple classes they are defined in the base class and inherited.

Which of the following are true about the object-oriented paradigm? (Select all that apply.) a. Objects only contain procedures b. The focus is on the creation of procedures c. The focus is on the creation of objects d. Private data is encapsulated in an object e. A procedure is an object called a function

Answers: c. The focus is on the creation of objects d. Private data is encapsulated in an object Notes: **Object-oriented programming focuses on the creation of objects. An object is a software entity that contains both data and procedures. The data stored within an object is the object's attributes, and the procedures contained within the object are referred to as the object's methods. Data is contained, or encapsulated, within an object and when defined as private can only be accessed by procedures contained within the same object.

Select all that are true about classes: a. Classes are created from objects b. Classes contain actual values stored in instance variables c. A class is another name for an object d. Classes encapsulate definitions of data e. Classes encapsulate behavior or methods

Answers: d. Classes encapsulate definitions of data e. Classes encapsulate behavior or methods Notes: **A class encapsulates the definitions of the data, the instance variables, and the behavior, the methods. Objects are created from classes and data, stored in instance variables are in objects not classes.

Which of the following are valid String declarations? a. String todaysWeather == "Rain"; b. String todaysWeather = new String ("Rain"); c. String todaysWeather = "Rain"; d. int todaysWeather [ ] = {"R", "a", "i", "n");

Correct answers: (b) is the usual way of defining objects (which Java Strings are) (c) is the usual way to define Strings (i.e. not using 'new') Wrong: (a) is incorrect because == is a conditional operator used in conditional clauses, not for assigning values to variables (d) this is wrong on so many levels >can't store String values as int >even if this was declared properly, rather than storing 'Rain' as a single string, it breaks up each letter into a different string. Hence, each letter will be a different String

If we have multiple constructors for a given class, which one will be executed when an object is created? a. Multiple constructors are not allowed b. We will specify the unique signature of the constructor was want c. They will have different names and we will specify the one we want d. All of them are executed in the order in which they are defined in the class e. We pass an argument to the constructor which is used to determine which constructor is executed

Correct: (b) - constructors just need to have different parameters lists Wrong: (a) is wrong because you can have as many constructors as you want (c) constructors have the same name (i.e. the same name as the class), just different parameters (d) constructors aren't actually executed unless instantiated (i.e. specifically called by method) (e) we don't pass an argument to the constructor-- we simply call the proper argument list

Which of the following are true about the Java statement public static void main (String[] args)? (Check all that apply.) a. You can leave out the word "static" if you like b. The word "main" is user defined, you can call it anything you like c. It is always required in a Java application program d. It is a method header e. It is a class header

Correct: c. It is always required in a Java application program d. It is a method header e. It is a class header (a) is wrong because 'static' signifies that method main is in memory and can be executed w/o an object (b) is wrong because main method is required to execute all Java progams

What will the value left in i be after the following Java code is executed? int i=0; for (int j = 0; j < 5; j = j + 2) i += j; a. 6 b. 0 c. 10 d. 15

Final outcome of code: i = 6

What will be printed by the following code? int x = 12; if ( x < 5 || x > 15 ) System.out.println ("1"); else if ( x > 5 && x < 10 ) System.out.println ("2"); else System.out.println ("3"); a. 1 b. 12 c. Nothing d. 2 e. 3

Outcome of code: 3

Which of the following are primitive Java data types? (Check all that apply.) -int -integer -array -double -String

Primitive data types: -int -double Notes: **Array and string are NOT primitive data types.

Which of the following are properties of a system? (Check all that apply.) -Produce output(s) -Consist of independent parts -Consist of interdependent parts -Accomplish a specific function -May have input(s)

Properties of a system include all answer choices listed

Protocols define which of the following aspects of a message? (Check all that apply.) -syntax -semantics -routing -content -timing

Protocols define the following 3 aspects of a message: -syntax -semantics -timing

String todaysWeather = new String ("Rain"); Which of the following are true statements regarding the statement above? a. todaysWeather is a variable name b. "Rain" resides in the memory heap for the program c. String is a reference variable d. todaysWeather is a reference variable e. todaysWeather contains the address in memory of the String object "Rain" f. todaysWeather resides in the memory heap for the program

The following are true about the above statement: a. todaysWeather is a variable name b. "Rain" resides in the memory heap for the program d. todaysWeather is a reference variable e. todaysWeather contains the address in memory of the String object "Rain" (c) is wrong because String is the data type. todaysWeather is the ref. variable (f) is wrong because the String itself is in the memory heap; the variable only exists in the program

Which of the following are true regarding a Java method? (Check all that apply.) a. A Java method must return a value. b. Calls to Java methods may include parameter variables. c. The scope of a local variable defined within a Java method is within the method. d. Arguments to Java methods are passed by value. e. Java method headers must include the data type for each parameter variable.

The following are true regarding a Java method: c. The scope of a local variable defined within a Java method is within the method. d. Arguments to Java methods are passed by value. e. Java method headers must include the data type for each parameter variable. Notes: (a) is false because void methods do not return a value (b) is false because parameter variables are included in the method header but not in the method call itself. In the call, we only include the argument

Objects are created from classes by using which operator? a. Open b. New c. Create d. Object

b. 'New' operator

Given the following method: public static int doSum(int a, int b) { if (a < 0) a = -a; if (b < 0) b = -b; return a + b; } the sequence of statements.... int a = -10; int b = -20; int sum = doSum(a,b); System.out.println (a + "," + b + "," + sum); .... will produce what output? Answers a. 10, -20, -30 b. -10, -20, 30 c. -10, -20, -30 d. -10, 20, 30

b. -10, -20, 30 the method means: if a is a negative integer, make it positive (i.e. a = -a... or (-1) = -(-1)). same thing with b. doSum will return the absolute value of a + b. sum = |-10| + |-20| = 30 Now... print a (i.e. -10), print b (i.e. -20), and print sum (i.e. 30) -10, -20, 30.

What will be printed by the following Java program? public class Scope_of_i { public static void main (String [] args) { int i; for (i=1; i<3; i++) { System.out.print (i); } System.out.print (i+1); } } a. 121 b. 124 c. 1224 d. This program would not compile

b. 124 Process: RUN 1 i = 1 1 < 3 (conditional clause) TRUE print 1 i = 1+1 (block termination) RUN 2 i = 2 2 < 3 TRUE print 2 i = 2 + 1 (block termination) RUN 3 i = 3 3 < 3 FALSE EXIT FOR LOOP i = 3 + 1

How do we determine if sport1 is the same as sport2? String sport1 = new String ("Soccer"); String sport2 = new String ("Tennis"); a. if "Soccer" = "Tennis" b. if "Soccer" == "Tennis" c. if (sport1.equals (sport2)) d. if sport1 == sport2

c. if (sport1.equals (sport2)) Notes: **The equals method is the only valid way shown to COMPARE the two STRINGS Soccer and Tennis. sport1 and sport2 contain the address of the String objects in memory, not the strings themselves.

Given the array: int[] values = {0, 1, 2, 3, 4}; What is the value of the expression: values[1] + values[5]? a. 6 b. 4 c. 7 d. None of the given choices

d. None of the given choices Reason: There is no value for [5] in this array **remember Java arrays use base-and-displacement indexing (i.e. first value has index value of 0)

Given the array: int[] values = {0, 1, 2, 3, 4}; What is the value of the expression values.length? a. 4 b. 0 c. 5 d. Syntax error

int[] values = {0, 1, 2, 3, 4}; values.length = 5

Which of the following must a Java programmer do in order to print multiple items? (Check all that apply.) -Separate the items by a + -Only have items that are string literals -Separate the items by a comma -Must have a separate print statement for each item -Use only variable identifiers (names)

(b) is incorrect because you can also print data contained in reference variables > x=1; ... System.out.println(x + " + " x + " = 2");.... 1 + 1 = 2 (c) is wrong because printed items are separated by + sign, not commas (d) is wrong because items can be printed within the same print statement (e) is wrong... see explanation for (b)

Which of the following are output devices? (Check all that apply) -Keyboards -Sensors -Hard drives -Flash memory sticks -Printers -Mice

-Hard drives -Flash memory sticks -Printers **Printers are output devices, and hard drives and flash memory sticks can be both input and output devices.

Which of the following are part of the instruction cycle? (Check all that apply.) a. Load the program into memory b. Clear the registers c. Advance the Program Counter to the next instruction d. Decode the instruction (determine what the instruction will do) e. Fetch the instruction from main memory

1. Determine the address of the next instruction to be executed 2. CORRECT (e) Fetch the instruction from main memory 3. CORRECT (d) Decode the instruction (determine what the instruction will do) 4. Determine addresses of 0 or more operands 5. Fetch 0 or more operands 6. Perform (execute) the instruction 7. Determine the address of where to store the results 8. Store the results of the instruction 9. CORRECT (c) Advance the program counter to memory address of the next instruction

What is the maximum number of subsections that could occur within the header of a Java for loop? Subsections are bounded by round parentheses and interior semicolons. a. 2 b. 1 c. As many as you want d. As many as you need e. 3

3 is the maximum number of subsections that could occur within the header of a Java for loop. (consider for statements)

What will this print? int a=5, b=10, sum=0; if ((a++==5)||(++b==10)) { sum=a+b; } System.out.println(a + ", " + b + ", " + sum);

6, 10, 16

int a=5, b=10, sum=0; if ((a++==5)&&(++b==10)) { sum=a+b; } System.out.println(a + ", " + b + ", " + sum);

6, 11, 17

A web browser and the web are an example of what type of system architecture? -client-server architecture -multitier architecture -host-based architecture -peer-to-peer architecture -client-based architecture

A web browser and the web are an example of a client-server architecture

Which of the following are true about the toString method? (Select all that are true.) a. It is automatically invoked when an object is "printed" b. It returns the object in which it is defined c. It is called when an object is created d. It prints information about an object e. It returns a string constructed within the method

Answers: a. It is automatically invoked when an object is "printed" e. It returns a string constructed within the method Notes: ** When an object is printed the toString method is automatically invoked. It returns a string.

Which of the following are characteristics of a host-based architecture? (Check all that apply.) a. heavy network demand b. dumb terminals c. time sharing d. serial communication e. personal computers

Characteristics of a host-based architecture are: b. dumb terminals c. time sharing d. serial communication Choice (a) is wrong because host-based architecture performed ALL logic on the mainframe. Hence, data did not have to get passed back and forth through the network. Notes: **Host-based architectures put all the processing on a single computer and provide a simple text-based interface to a dumb terminal.

Which of the following is true in a correct implementation of a recursive method definition: a. A base condition is optional. The recursive method will terminate anyway. b. A recursive method is usually written to call itself forever c. Recursive methods are written using loop statements. d. A base condition is required so that the recursive method will terminate after a finite number of invocations.

Correct answer: d. A base condition is required so that the recursive method will terminate after a finite number of invocations. (a) is false because a base condition is REQUIRED in order for recursion to terminate (b) is false... see explanation for (a) (c) is false because recursive methods are written using if statements

Please select the purpose or purposes of the [] operator (double square brackets) from the expressions below. a. They specify that the preceding variable is an array. b. They are arithmetic operators. c. They enclose a minor scope d. They may enclose an expression which evaluates to an array index. e. They may enclose a count of array members.

Correct answers: (a) (d) - example: showValue.x[2]... so if array was {"blue", "red", purple"}, purple would print >note that reference variable is followed by [ ] (e) -example: int [ ] x = new int[size]; Incorrect: (b) is wrong because arithmetic operators are +, -, /, * (c) is wrong because scopes are enclosed in curly braces

What technology is primarily used to prevent penetration attacks? -cryptographic systems -compression -firewall -encryption -hashing

Firewalls are used to prevent penetration attacls

If c equals negative two, what does a equal in the following Java statement? a = 2 + c++ i. 2 ii. 0 iii. 2 iv. 6 v. 1

If c = -2 And a = 2 + c++ Then a = 0 Notes: c++ is a post-increment. The value of the variable a is not affected by the post-increment of c. Hence, the proram first evaluates: a = 2 + -2.... a=0. After this statement is executed, c will be incremented by one and will equal negative one.

In terms of an RDBMS, what is metadata? -Extremely large volumes of data -Data of a mathematical nature -Data definitions and relationships -Data of the restrictive data types, such as date and currency

In terms of an RDBMS, metadata refers to data definitions and relationships.

The programming process in Java includes which of the following activities? (Check all that apply.) a. Resolving all program logic errors b. Developing invalid input as test data c. Determining program output display d. Determining what the program is supposed to accomplish e. Writing machine code

Java includes ALL of the answer choices EXCEPT: e. Writing machine code Note: **Java writes in BYTE CODE

What is the purpose of a router? -To transfer packets from a wireless network to a wired network -To switch frames within a network -To translate DNS names to IP addresses -To transfer packets from one network to another network -To assign IP addresses to computers

Only the following is true about the purpose of a router: -To transfer packets from one network to another network

What is the name of the portion of an instruction that determines what the instruction does? -Function code -Indirect bit -Op-code -Register designation -Operand specifier

The portion of an instruction that determines what an instruction does is the OP-CODE.

What organization is responsible for establishing standards that govern how the Internet operates? -Institute of Electrical and Electronic Engineers (IEEE) -The International Organization for Standardization (ISO) -The International Telecommunications Union - Telecommunications Group (ITU-T) -The American National Standards Institute (ANSI) -Internet Engineering Task Force (IETF)

The Internet Engineering Task Force (IETF) is responsible for establishing standards that govern how the Internet operates. ISO → international recommendations ANSI → American Standards based on ISO IEEE → LAN ITU-T → telephone and computer networks (think AT&T) IETF → Internet

Please select from the following list what a + (plus) sign means when it is associated with two Java Strings. a. The + sign has no meaning because the two Strings are independent objects. b. The two Strings are added together character-by-character. c. The two Strings become primitive variables. d. The second string is appended to the end of the first String.

The answer is (d). A plus sign (+), when it is associated with to Java Strings, means that the second string is appended to the end of the first String.

Please select all of the clauses below which indicate an aspect of the if statement -A conditional statement -Can alter the flow of the program execution -Capable of assigning a value -Followed by one or more action clauses -Followed by an open round parenthesis

The clauses below indicate an aspect of the if statement: -A conditional statement -Can alter the flow of the program execution -Followed by one or more action clauses -Followed by an open round parenthesis Notes: **The if statement cannot assign a value (C). All other statements are true.

Which iterative procedure in Java always executes the subscope of code at least once? -do until -while -do...while -for

The do...while procedure in Java always executes the subscope of code AT LEAST once.

What is contained in the header added to the protocol data unit (PDU) by the internet layer? (Check all that apply.) -a datagram -the destination MAC address -the sender and receiver IP address d. segmentation information e. the payload

The sender and receiver IP address are contained in the header that is added to the PDU

Which of the following statements are true regarding the SQL INSERT command? (Check all that apply.) a. If the INSERT command executes successfully, the table will contain the data it inserted. b. The INSERT command is used to insert data one column at a time. c. The INSERT command can be used to change cell data types. d. The INSERT command may need to use different syntax depending on the data type of the data it is inserting.

This is the only true statement regarding the SQL INSERT command: d. The INSERT command may need to use different syntax depending on the data type of the data it is inserting. >For example, VARCHAR values are surrounded by quotes Choice (a) is wrong because the INSERT command needs to be followed by a COMMIT command in order for the data to be inserted into the table. It can execute successfully and the data may still not be in the table w/o COMMIT; Choice (b) is wrong because the INSERT command inserts data one ROW at a time, not column. Choice (c) is wrong because the INSERT command cannot be used to change data types

Which of the following are valid declarations of an array in Java? (Check all that apply.) a. int a[] = new int {10} b. int a[] = new int [10] c. int a{} = new int {10} d. double b[] = {1.23, 2.34, 3.45}

Valid declarations of an array in Java: a. int a[] = new int {10} d. double b[] = {1.23, 2.34, 3.45} (b) is wrong because it encloses the array in square brackets instead of curly braces (c) is wrong because the array declaration uses curly braces (it should be square brackets)

Assuming the following statements have been executed, what is stored in answer? int i = 7; int n = 2; int answer; answer = i/n; a. 3 b. 5 c. 14 d. 3.5 e. 0.2857

answer = 3

Which of the following are objectives of securing a network? (Check all that apply.) -confidentiality -availability -proper ordering of messages -elimination of redundancy by compressing data -integrity

The following are objectives of securing a network: -confidentiality -availability -integrity

Which of the following services are provided by the operating system (OS)? (Check all that apply.) a. Application Program Interfaces (APIs) b. User authentication systems c. Productivity Software d. Web Authorizing Software e. CAD/CAM Software f. Personal Information Management Software

Answers: a. Application Program Interfaces (APIs) b. User authentication systems All other choices are wrong because they are services provided by application software, not OS.

Which of the following are true about programming for databases? (Check all that apply.) a. Database programming can be useful for extending security in a database application. b. A database program can be useful for loading a data warehouse. c. Most RDBMS include a programming language that allows the programmer to execute SQL commands integrated with conventional programming constructs. d. A database programmer can write code that will execute different commands based on different conditions.

All of the answer choices are true about programming for databases.

Which of the following characterize cloud computing? (Check all that apply.) -customization -static resource allocation -IT-assisted services -rapid scalability

Among the answer choices, only rapid scalability characterizes cloud computing. Notes: **Customization, static resource allocation, IT-assisted services are NOT characteristic of cloud computing

Which of the following access privileges are provided by an RDBMS? (Check all that apply.) a. User access to the entire database. b. User access to specific cells in the database. c. User access to specific tables in the database. d. User access to specific operations on specific tables in the database. e. User access to specific operations on specific attributes of specific tables in the database.

An RDBMS provides the following access privileges: a. User access to the entire database. c. User access to specific tables in the database. d. User access to specific operations on specific tables in the database. e. User access to specific operations on specific attributes of specific tables in the database. -Choice (b) is just stupid. Who would need only access to just ONE specific cell?

An operating system performs which of the following functions? (Check all that apply.) a. Provides an interface for users b. Compiles programs c. Runs and controls the hardware directly d. Provides for efficient use of hardware resources e. Word processing

An operating system is a program, or set of programs, that performs a number of important functions including: 1. CORRECT (b) runs and controls the hardware directly 2. CORRECT (d) provides for efficient use of hardware resources 3. provides an interface for applications programs 4. CORRECT (a) provides an interface for users 5. manages network functions 6. provides a secure and safe environment

Which of the following are characteristics of an algorithm? (Check all that apply.) a. Algorithms can assume certain input b. The steps of an algorithm must be performed in a particular order c. An algorithm is a sequence of instructions d. A computer program constitutes an algorithm e. Creating an algorithm is usually a trivial task

Characteristics of an algorithm (i.e. a sequence of instructions): b. The steps of an algorithm must be performed in a particular order c. An algorithm is a sequence of instructions d. A computer program constitutes an algorithm (a) is incorrect because writing an algorithm must be precise, nothing can be assumed (d) is incorrect because creating an algorithm can be very challenging Notes: **Each instruction accomplishes a specific operation that is vital to the overall task at hand and must be performed in a certain sequence.

Which of the following is a valid method header for the "main" method required in each Java application? a. public static void main ( String [] args); b. public static void main (String args); c. public static int main (String [] args); d. private static void main(String [] args); e. public void main (Strings [] args);

Correct Answer: a. public static void main ( String [] args); **Wrong answers: (b) is missing [ ] after String (c) method main header not contain a variable type (d) method main should be public (e) method main should be static

The three major characteristics of business applications are: -development of algorithms -processing of user data -manipulating variables -user interactions -database or file access

IT systems usually include three major areas: 1. processing of user data 2. user interactions 3. database or file access Business applications are a type of IT system

Which of the following are top level subsystems of a computer? (Check all that apply.) -Main Memory -Processor (CPU) -Input/Output (I/O) -Registers -ALU

The following are top level subsystems of a computer: -Main Memory -Processor (CPU) -Input/Output (I/O) -System interconnections

Multitier architectures do which of the following? (Check all that apply.) -are ones where each machine is both a client and a server -run client/server applications -were popular in the 60s and 70s to run timesharing -distribute processing functions over 2 or more computers

Multitier architectures do the following: -run client/server applications -distribute processing functions over 2 or more computers

Please select all entries in the list below which are correct about the Scanner class a.The Scanner class allows the Java program to accept a text string from the user's keyboard. b.The Scanner class allows the Java program to accept input of a single character into a char field. c.The Scanner class allows the Java program to accept an integer number from the user's keyboard. d. The Scanner class is found in the util package of the Java API library.

Notes: **Although a single character may be accepted into a Java program using the Scanner class, it must be accepted as part of a String. All other answers are correct.

Which of the following are true about the UPDATE command? (Check all that apply.) a. The UPDATE command can include a SET or WHERE clause, but these are optional. b. After using the UPDATE command, you'll need to use a SELECT command to see the changes. c. If a SET clause is used, a WHERE condition must also be used. d. The UPDATE command is a way to change the data type of a column in the table.

Only the following is true about the UPDATE command: b. After using the UPDATE command, you'll need to use a SELECT command to see the changes. Notes: ** The WHERE clause is optional in an UPDATE command, but SET is required. **The UPDATE command changes the values, but you'll need to use a SELECT command to retrieve the updated data

Operating systems maximize processor usage by doing which of the following? (Check all that apply.) -Keeping one program in memory at a time -Executing a program that isn't waiting for I/O -Increasing processor speed to match the speed of I/O -Accessing main memory and multiple levels of cache simultaneously to improve the hit ratio

Operating systems maximize processor usage by executing a program that isn't waiting for I/O

What is the outcome of the following code? int a = 5, b = 10, sum = 0; if ((++a == 5) || (++b == 10)) { sum = a + b; } System.out.println(a + "," + b + "," + sum); a. 5, 10, 17 b. 6, 10, 16 c. 6, 11, 0 d. 5, 10, 0

Outcome of code: 6, 11, 0 This statement means: -first, pre-increment a... 5+1 = 6 if 6=5..... - OR - -pre-increment b... 10+1=11 if 11 = 10.... (again, if 6=5 -OR- 10=11.... then sum = 6+11.... neither of the statements are true so sum remains unchanged (i.e. value of 0)

What is the outcome of the following code? int x = 10, y = 20; switch (x) { case 5: y = 10; case 10: y = 20; case 15: y = 30; } System.out.println(y); Answers: a. 10 b. 30 c. 20 d. None of the given choices

Outcome of code: b. 30 Explanation: since x = 10, the switch statement goes straight to case 10: y=20. However, since break; is not added to the code, the switch statement continues to execute the rest of the subscope... it proceeds to case 15: y=30. Hence, y = 30.

What is the outcome of the following code? do { System.out.println("CS200"); } while (false); Answers: -CS200 is printed once -Nothing is printed -CS200 is printed twice -CS200 is printed continuously

Outcome: -CS200 is printed once

Which of the following are fields (parts) of a machine language instruction? (Check all that apply.) -Program Counter -Function code -Op-code -Operand specifier -Instruction register

Parts of machine language instruction include: 1. Op-code 2. Operand specifier

Pipelining involves which of the following? (Check all that apply.) a. The sequential execution of one instruction after another b. Doing multiple I/O operations at the same time c. Starting the instruction cycle for one instruction before the instruction cycle for another instruction has been completed d. Doing two fetch operations at the same time e. Executing more than one instruction simultaneously on single processor

Pipelining involves the following: c. Starting the instruction cycle for one instruction before the instruction cycle for another instruction has been completed e. Executing more than one instruction simultaneously on single processor -(a) is incorrect because pipelining involves doing a step for another instruction while in the middle of another -(b) is incorrect because it's irrelevant -(d) is incorrect because a processor cannot simultaneously perform the same stage for two different instructions

Which of the following are Quality Assurance personnel roles? (Check all that apply.) a. Developing application programs b. Defining test cases c. Producing quality assurance plans for an application d. Defining quality metrics e. Developing test beds

Quality Assurance personnel do the following: -Defining test cases -Producing quality assurance plans for an application -Defining quality metrics -Developing test beds **QA personnel don't develop application programs

Which of the following are true about DDL commands? (Check all that apply.) a. DDL commands can only be issued when the database is first created. b. DDL commands are part of the SQL language. c. DDL commands include CREATE, UPDATE and ALTER. d. DDL commands are used to create and modify table structures.

The following are true about DDL commands: b. DDL commands are part of the SQL language. **The SQL language consists of a DDL, a DML, and a DCL d. DDL commands are used to create and modify table structures. Choice (a) is wrong because ALTER and DROP can be used anytime Choice (c) is wrong because UPDATE is part of DML. DDL is CREATE, ALTER, and DROP

In the simplified model of a processor presented in the online content what register is updated at the end of the instruction cycle to contain the memory address of the next instruction to be executed? -Instruction register -Memory address register -Memory buffer register -Accumulator -Program counter

The **program counter** is updated at the end of the instruction cycle to contain the memory address of the next instruction to be executed is:

Which of the following are components of a network? (Check all that apply.) a. network standards b. protocols c. communications devices d. messages e. hard drives

The components of a network are: b. protocols c. communication devices d. messages Choice (a) is wrong because standards are just definitions of how computers should operate. They are not actually a component of networks. Choice (e) is not specifically a component of a network (no more than a mouse or keyboard is)

What is the dominant technology used in desktop area networks? -Ethernet -infrared -Bluetooth -DSL -RFID

The dominant technology used in desktop area networks is Bluetooth.

Which of the following are important to business systems analysis and design? (Check all that apply.) a. the organization and documentation of a business system b. the development and goals of business systems c. tools commonly used in the development of a business system d the daily reporting cycle of the quality analysis group

The following are important to business systems analysis and design: a. the organization and documentation of a business system b. the development and goals of business systems c. tools commonly used in the development of a business system Notes: **Development and goals, tools, organization and documentation are all important to the work of the business analysts. The daily reporting cycle of the quality analysis group is far downstream from business analysis function.

The Java SE language system consists of which of the following? (Check all that apply.) -a debugger -a text editor -a compiler -a runtime environment -an interpreter

The following are included in the Java SE language system: 1. a compiler (javac), 2. a runtime environment (JRE) Notes: **a debugger, a text editor, and an interpreter are NOT included in Java SE. These are included in the IDE Eclipse.

Which of the following are true about DML commands? (Check all that apply.) a. DML commands update the structure of tables in the database. b. A SELECT command is a valid DML command. c. To create a report from existing tables, you would use DML commands. d. DML commands are used to update and retrieve data in the database.

The following are true about DML commands: b. A SELECT command is a valid DML command. c. To create a report from existing tables, you would use DML commands. d. DML commands are used to update and retrieve data in the database. -Choice (a) is wrong because DDL commands update the STRUCTURE of the database, not a DML. DML update the data itself. Notes: **A SELECT command is a DML command, used for accessing the data. **To create a report, you need to retrieve data, so you would use DML commands to accomplish this.

Please select all of the following statements which apply to the Eclipse Integrated Development Environment (IDE). a.Eclipse should be installed on your system after the installation of the Java language system if you are going to use Eclipse for your IDE. b. Eclipse replaces the Java Virtual Machine. c. Eclipse is one of many IDEs which may be installed to use the Java language software. d. The Eclipse IDE facilitates the development of Java programs. e. Eclipse must be used to develop and run Java programs.

The following are true about Eclipse IDE: a. Eclipse should be installed on your system after the installation of the Java language system if you are going to use Eclipse for your IDE. c. Eclipse is one of many IDEs which may be installed to use the Java language software. d. The Eclipse IDE facilitates the development of Java programs. (b) is wrong because you still need to install JVM to use Java in Eclipse (d) is wrong—you can use any IDE (e.g. Netbeans or jGRASP) to run Java programs

Which of the following are true regarding the Java method main? (Check all that apply.) a. In the declaration of main, the term "static" means that the main method exists in memory and can be executed without creating an object. b. In the declaration of main, the term "public" means that the main method is available from anywhere within the program. c. The method main is called by the Java compiler. d. The method main is called by the Java Virtual Machine when the program is started. **REVIEW THE CONCEPTS OF THIS QUESTION!**

The following are true about Java main method: a. In the declaration of main, the term "static" means that the main method exists in memory and can be executed without creating an object. d. The method main is called by the Java Virtual Machine when the program is started. (b) is wrong because 'public' makes main available to ALL programs (and classes) (c) is wrong because the compiler doesn't actually call anything. It only makes sure your source code follows proper format (i.e. syntax)

Which of the following are true about Java string literals? (Check all that apply.) -A Java string literal is delimited by single quotes -When a Java string literal appears within the parenthesis of a println statement it will print out exactly as it appears -A Java string literal can contain letters of the alphabet and the digits 0 through 9 -The value of a Java string literal can change

The following are true about Java string literals: -When a Java string literal appears within the parenthesis of a println statement it will print out exactly as it appears -A Java string literal can contain letters of the alphabet and the digits 0 through 9

Which of the following are true about cache memory? (Check all that apply.) -Cache is non-volatile -Cache improves memory performance -Cache is slower than main memory -Cache contains a subset of main memory -There can be multiple levels of cache

The following are true about cache memory: -Cache improves memory performance -Cache contains a subset of main memory -There can be multiple levels of cache

Which of the following are true about creating a join? (Check all that apply.) a. The JOIN phrase is used with the SELECT command. b. Only two tables can be joined in one SQL command. c. The RDBMS may require the column names in a join to be prefixed by the table name. d. An inner join usually combines two columns of the same table.

The following are true about creating a JOIN: a. The JOIN phrase is used with the SELECT command. c. The RDBMS may require the column names in a join to be prefixed by the table name. -Choice (b) is wrong because you can run 2 or more tables as long as they all share a common field -Choice (d) is wrong because an INNER JOIN combines columns from two tables

Which of the following are true about logic errors? (Check all that apply.) a. Logic errors are detected by the compiler b. Logic errors must be fixed before testing c. Logic errors potentially result in incorrect program output d. Logic errors are detected by analyzing the operation of a program e. Logic errors are detected at runtime

The following are true about logic errors: c. Logic errors potentially result in incorrect program output d. Logic errors are detected by analyzing the operation of a program >prevent them by checking that pseudocode statements are in the correct order, checking that all data is available and valid, and checking that calculations are done properly. e. Logic errors are detected at runtime (a) is incorrect because the compiler will not always find a logic error (e.g. boolean statement such as "if true then execute" might execute forever) (b) is incorrect because logic errors are generally uncovered through testing using both valid and invalid input data. You might not find them until testing Note: **Logic errors are errors that can cause a program to give incorrect results.

Which of the following statements are true regarding machine language and data representation in a computer system? a. Bits are based on the decimal number system. b. It takes 8 bytes to represent a character using the ASCII data encoding scheme. c. Storage capacity of memory is measured in numbers of bits or bytes. d. Every piece of data can be represented by a series of zeros and ones. e. One bit represents many different transistors inside a processor.

The following are true about machine language and data representation in a computer system: c. Storage capacity of memory is measured in numbers of bits or bytes. d. Every piece of data can be represented by a series of zeros and ones. -Choice (a) is WRONG because bits are in BINARY, not decimal -Choice (b) is WRONG because a character in ASCII takes 8 BITS to represent (8 bits = 1 byte) -Choice (e) is WRONG because one bit only represents the state of one SINGLE transistor (on/off)

Which of the following statements are true about Java? (Check all that apply.) a. Java was developed for embedded applications b. The Java compiler generates machine code c. Java was developed at IBM d. Java does not support objects e. A Java program runs on a Java Virtual Machine

The following are true: a. Java was developed for embedded applications e. A Java program runs on a Java Virtual Machine (b) is wrong because Java generates BYTE code (c) Java was developed at Sun Microsystems for apps embedded in devices (d) Java is an object-oriented langauge

Which of the following are true about primary keys? (Check all that apply.) a. Primary keys are used for referential integrity in spreadsheet applications. b. A primary key can be one attribute or several attributes combined. c. A primary key uniquely identifies every row or record in the table. d. A primary key can have a null value.

The following are true about primary keys: b. A primary key can be one attribute or several attributes combined. c. A primary key uniquely identifies every row or record in the table. Choice (a) is wrong because referential integrity is not supported by spreadsheet applications. Also, referential integrity refers to foreign keys. **A primary key must be a collection of attributes the value of which uniquely identifies every row or record. Sometimes this can be accomplished with one attribute, such as an order number in an Order table, and sometimes it is necessary to combine attributes to create a unique key, such as using an order number and line number together in a Line_Item table. **A primary key must uniquely identify the row or record. There cannot be duplicate primary key values in the same table.

Which of the following are true about the ALTER TABLE command? a. ALTER TABLE command allows you to add a constraint to an existing table. b. The ALTER TABLE command allows you to delete a column from a table based on a condition in the WHERE clause of the command. c. The ALTER TABLE command allows you to modify the data type of a column in an existing table. d. The ALTER TABLE command allows you to change data in a record after it has been inserted. e. The ALTER TABLE command allows you to add a new column to an existing table.

The following are true about the ALTER TABLE command: a. ALTER TABLE command allows you to add a constraint to an existing table. c. The ALTER TABLE command allows you to modify the data type of a column in an existing table. e. The ALTER TABLE command allows you to add a new column to an existing table.

Which of the following are true about the DROP TABLE command? a. The ALTER TABLE...DROP command can achieve the same result as the DROP TABLE command. b. The DROP TABLE command allows you to specify a condition whereby only certain data is deleted. c. The DELETE command must be used in conjunction with the DROP TABLE command to delete the data in a table before it is dropped. d. Once a table is dropped, it no longer exists in the system catalog. e. The DROP TABLE command is a DDL command.

The following are true about the DROP TABLE command: d. Once a table is dropped, it no longer exists in the system catalog. e. The DROP TABLE command is a DDL command. -(a) and (b) are both wrong because ALTER TABLE... DROP would only delete a very specific tuple or attribute. DROP TABLE would delete the entire table -(c) is wrong since DROP TABLE would delete everything w/o need for DELETE command

Which of the following are true regarding the use case model? (Check all that apply.) a. Another system can be an actor in a use case model. b. A use case diagram shows the executing order of use cases. c. A use case model shows the functionalities of a system from the user's view. d. Inheritance relationships can be used by both actors and use cases. e. A use case model shows how data flows among different use cases

The following are true about the use case model: a. Another system can be an actor in a use case model. c. A use case model shows the functionalities of a system from the user's view. d. Inheritance relationships can be used by both actors and use cases. -Choice (b) applies to a state transition diagram. Use case diagrams don't show executing but rather shows the actors in a system and the relationships between them -Choice (e) is incorrect since use case diagrams show relationships, not order of data flow

Which of the following are true regarding Java syntax? (Check all that apply.) a. a comment starts with \\ b. a single java statement cannot occupy more than one line c. indentation is important to Java d. blank lines are ok e. Curly braces, { }, always exist in pairs

The following are true regarding Java syntax: d. blank lines are ok e. Curly braces, { }, always exist in pairs (a) is wrong. a comment starts with // (forward slashes) not \\ (backslashes) (b) is wrong—a single Java statement can occupy as many lines as needed (c) is wrong—indentation is used strictly to make a program more readable and is ignored by the compiler.

Which of the following statements are true regarding registers? (Check all that apply.) a. There are generally over 1000 registers in every processor. b. Registers are temporary storage locations. c. All registers are available to application programmers for their use. d Registers can be accessed quickly.

The following are true regarding registers: b. Registers are temporary storage locations. d. Registers can be accessed quickly. -Choice (a) is incorrect. Some processors have fewer than 100 registers. -Choice (c) is incorrect. Control and status registers aren't available to programmer's machine language instructions

Which of the following statements are true regarding the Java do...while statement ? (Check all that apply.) a. The subscope of the loop is not executed following the do keyword. b. Testing is done prior to entering the subscope of the loop. c. The do keyword appears at the top of the loop and the while at the bottom. d. The subscope of the loop is executed once before testing to continue the iteration. e. Testing is done following the subscope of the loop.

The following are true regarding the Java do...while statement: c. The do keyword appears at the top of the loop and the while at the bottom. d. The subscope of the loop is executed once before testing to continue the iteration. e. Testing is done following the subscope of the loop. (a) is incorrect because subscope is execute at least once (b) is incorrect because testing is done only after the subscope is executed at least once

Which of the following are true regarding the general description of keywords in a computer language? (Check all that apply.) a. The meaning of a keyword is determined by the context in which it is used in a program. b. A particular keyword has the same meaning as its equivalent English word. c. A particular keyword is used only in particular ways in a language. d. Keywords in a language must be recognizable words in a written language. e. A particular keyword has one or more specialized meanings in the language.

The following are true regarding the general description of keywords in a computer language: a, The meaning of a keyword is determined by the context in which it is used in a program. c. A particular keyword is used only in particular ways in a language. e. A particular keyword has one or more specialized meanings in the language. Notes: **Keywords do not have to mimic English words or words in any other language. Hence, the following options are wrong: -A particular keyword has the same meaning as its equivalent English word. -Keywords in a language must be recognizable words in a written language.

Which of the following events might disrupt the normal sequential flow of program execution causing control to be transferred to an exception or interrupt handler? (Check all that apply.) a. Advancement of the Program Counter to the next instruction b. Program completion c. An arithmetic overflow d. A division by 0 e. Completion of a disk I/O operation

The following events cause control to be transferred to an exception or interrupt handler: b. Program completion c. An arithmetic overflow d. A division by 0 e. Completion of a disk I/O operation Notes: **Choices b,c and d are exceptions and e is a hardware interrupt. In either case the current program execution is stopped and control transfers to an exception or interrupt handler routine to deal with the event.

Which of the following are true about the SELECT command? (Check all that apply.) a. The WHERE clause is optional in the SELECT command. b. A SELECT command can be used for specifying rows for updating. c. The SELECT command is used to do a join between two tables. d. The WHERE clause contains only one condition.

The following is true about the SELECT command: a. The WHERE clause is optional in the SELECT command. b. A SELECT command can be used for specifying rows for updating. c. The SELECT command is used to do a join between two tables. -Choice (d) is wrong because you can use a WHERE clause with multiple conditions using an "OR" connecting phrase Example: ......WHERE City = 'Houston' OR City = 'Milwaukee'

Which of the following keywords represent the three forms of iterative loops in Java? (Check all that apply.) -while -do...while -begin -each -for

The following keywords represent the three forms of iterative loops in Java: -while -do...while -for

Which of the following statements are true? (Check all that apply.) a. Java objects are created by declaration statements that include the class name and object name b. Java objects are created by the new operator c. Java objects are created at execution (run) time d. Java objects are created by a class declaration in the source file e. Java objects are created by the compiler when you compile your source code

The following statements are true about Java: b. Java objects are created by the new operator c. Java objects are created at execution (run) time (a) - Cindy still needs to clarify why this isn't true (d) isn't true because a class declaration doesn't actually instantiate the object. You still need to use the operator "new" (e) isn't true because objects are created during runtime, not during compiling (page 35) Challenge: **Why aren't the other answer choices true?

Which of the following are true about foreign keys? (Check all that apply.) a. A foreign key creates a relationship between two tables. b. A foreign key in one table relates to a primary key in a different table. c. Foreign keys can have a null value. d. A foreign key, like a primary key, uniquely identifies its record.

The following statements are true about foreign keys: a. A foreign key creates a relationship between two tables. b. A foreign key in one table relates to a primary key in a different table. c. Foreign keys can have a null value. Choice (d) is incorrect because a foreign key can have the same value in different records (i.e. it is does not uniquely identify its record). In the lecture example, for instance, Houston was in two different records as the city name, and had the same foreign key value. Notes: **A foreign key in one table matches the primary key in another table, which enables the database to enforce referential integrity rules. It is also possible for a foreign key to reference the primary key in the same table. (In some DBMS it is also possible for a foreign key to reference a unique set of columns in a table; this is an advanced topic which you are not responsible for.)

Which of the following were important advancements made in the industry in the 1970s and 1980s that led to a new type of system architecture? (Check all that apply.) -the development of VoIP -the development of commercial off-the-shelf software (COTS) -the development of inexpensive networks -the development of microprocessors -the development of unbounded media

The following were important advancements made in the industry in the 1970s and 1980s that led to a new type of system architecture: -the development of commercial off-the-shelf software (COTS) -the development of inexpensive networks -the development of microprocessors Notes: **the three important advancements were that silicon densities became great enough to make microprocessors, relatively inexpensive networks, such as Ethernet-based LANS, were developed, and COTS became available.

What is the highest layer processed by a switch? -physical -application -transport -data link -internet

The highest layer process by a switch is data link.

Which of the following is the internet layer responsible for? (Check all that apply.) -routing packets -representing bits (1 and 0) on the media -the end to end communication between the source and final destination entities -moving a protocol data unit (PDU) from sender to receiver within a single network -providing communication between two applications

The internet layer is responsible for: -routing packets Notes: **Contrary to what you might think, the internet layer is NOT responsible for the end-to-end communication between the source and the final destination entities. **The internet layer is responsible for communication between networks, not necessarily the communication between final destination entities

Which of the following are true about creating tables in SQL? (Check all that apply.) a. To define a primary or foreign key, you can use a CONSTRAINT clause. b. It is possible to alter the structure of a table after it has been created. c. The command CREATE TABLE creates the table structure. d. The COMMIT command is necessary after issuing a CREATE TABLE command to save the structure of the table in the database.

The only option that isn't true about creating tables in SQL is: d. The COMMIT command is necessary after issuing a CREATE TABLE command to save the structure of the table in the database. Notes: **A constraint clause can be used to define a primary or foreign key **An ALTER TABLE command can be used to alter the structure of a table after it has been created **The CREATE TABLE command is used to create the table structure, while the INSERT commands are needed to add data to the table

Please select the expression or expressions below which identify the purpose of a ! sign in a conditional clause a. Specifies the negation of an elementary equals operator. b. Precedes an if statement d. Terminates an action statement. e. Reverses the logical sense of a conditional clause.

The purpose of an explanation of an exclamation mark (!): a. Specifies the negation of an elementary equals operator. e. Reverses the logical sense of a conditional clause. (b) is wrong because the ! operator is actually inside the if statement (not before it) (c) is wrong because that's not what the ! operator does Note: **remember that the ! operator (a compound conditional operator) and != (an elementary conditional operator) are NOT THE SAME.

Which of the following are features of the relational database model? (Check all that apply.) a. Relational databases store data in tables, which are also termed relations. b. An object-oriented database is one type of relational database. c. A relational database includes a query language, such as SQL, for accessing and manipulating the data. d. The relational model is based on mathematical theory.

The relational database model has the following features: a. Relational databases store data in tables, which are also termed relations. (Tables in a relational database store the data in rows and columns.) c. A relational database includes a query language, such as SQL, for accessing and manipulating the data. **(SQL is a nonprocedural query language that facilitates creating database tables and manipulating the data in a relational database.)** d. The relational model is based on mathematical theory. (The mathematical theory includes relational algebra and relational calculus.) Choice (b) is wrong because an object-oriented database is NOT a type of relational database. It is database management system model, but it is completely separate from an RDBMS model.

What are the ways that an RDBMS differs from a spreadsheet application? (Check all that apply.) a. An RDBMS table can contain much more data than a spreadsheet. b. An RDBMS has more sophisticated security to control access to the data in the database. c. An RDBMS maintains transactions in logs to help recover the database if there is a problem. d. An RDBMS has integrity constraints which ensure that only authorized users can access the database.

The ways that differentiate an RDBMS from a spreadsheet application are: a. An RDBMS table can contain much more data than a spreadsheet. b. An RDBMS has more sophisticated security to control access to the data in the database. c. An RDBMS maintains transactions in logs to help recover the database if there is a problem. Choice (d) is wrong because BOTH spreadsheets and RDBMS can provide authorized user access. The difference is the LEVEL of security controls. **An RDBMS supports access controls that can restrict access to particular tables, columns, or even rows, including restricting access to particular operations on tables, columns and rows. Spreadsheets typically control access only at the level of the whole spreadsheet.

In Java, what does the statement below mean c += a i. c = a + 1 ii. c = c + a iii. c + 1 = a iv. c + c = a v. none of these answers are correct

This statement: c += a is the same as: ii. c = c + a

Which of these statements describe a Denial of Service (DoS) attack? a. The attacker sends a probe packet to determine the systems' vulnerability. b. The attacker sends an initial single break-in packet to begin the attack. c. Attack packets are smuggled into the system in a Trojan Horse. d. None of the above

Trick question. None of these are correct.

What are the two main components of an iterative loop in Java? (Check two.) -A subordinate scope of program code. -The evaluation of a boolean expression yielding either true or false -Its opening and closing round parentheses. -Its opening and closing curly brackets.

Two main components of an iterative loop in Java: 1. A subordinate scope of program code. 2. The evaluation of a boolean expression yielding either true or false

Which of the following are valid elementary conditional clauses? (Check all that apply.) i. a <= 5 ii. a => 5 iii. a = 5 iv. y ! 5 v. a > 5

Valid elementary conditional clauses: a<=5 a > 5 Notes: **The elementary conditional clause consists of three parts: 1. An operand which is a variable 2. A conditional operator, which may be any one of six, as follows o == equals, as distinct from = for assign o != not equals o < less than o <= less than or equals o > greater than o >= greater than or equals 3. Another operand which may be either a variable or a literal constant.

Which of the following are valid Java variable names? (Check all that apply.) -4tree -house -hourly_wage -pay rate -Course$Grade

Valid variable names: -house -hourly_wage (underscores are OK) -Course$Grade (dollar sign OK) Notes: **Rules for Java names: 1. the first character must be one of the letters a-z, A-Z, an underscore, or a dollar sign [CANNOT be a digit] 2. After the first character, you may use the letters a-z, A-Z, the digits 0-9, underscores or dollar signs. 3. Uppercase and lowercase letters are distinct, i.e., java is case sensitive, 4. Names cannot include spaces.

Which of the following are true about data types? (Choose all that apply.) a. A number can be declared with one of several different data types. b. Data types have the same names in all programming languages. c. Both spreadsheet applications and RDBMS tables include data types. d. BOOLEAN can be a data type

a. A number can be declared with one of several different data types. (e.g. INTEGER (no decimal places), REAL or FLOAT (with decimal places, like a currency amount) among others) c. Both spreadsheet applications and RDBMS tables include data types. d. BOOLEAN can be a data type Notes: **This is one of the purposes of data types. The other main purpose of data types is to control the kinds of data that can be stored.

Which of the following are true about data control language (DCL)? (Check all that apply.) a. DCL commands include GRANT and REVOKE. b. To set up referential integrity, you would use DCL commands. c. DCL commands are part of the way an RDBMS handles security. d. DCL commands include INSERT, UPDATE and DELETE.

a. DCL commands include GRANT and REVOKE. c. DCL commands are part of the way an RDBMS handles security. Notes: **DCL commands specify who can access data in the database and which operations they can perform.

Please select the name or names applied to Java programming material which is enclosed within round parentheses. a. Scope b. Conditional clause c. Parameter list d. statement e. Logical expression

b. Conditional clause c. Parameter list (a) is incorrect because scopes are enclosed within curly brackets { } (d) is incorrect because statements are generally terminated by semicolons. (e) is incorrect because the term 'logical expression' encompasses a lot of different types of expressions, which use many different operators Notes: **Conditional clauses and parameter lists are generally enclosed within round parentheses.


संबंधित स्टडी सेट्स

livro anatomy questions for the mrcs 1ed

View Set

IB Global Politics: Development articulation sentences from the pink book

View Set