BU CS200 Final

The flashcards below were created by user Kevinpom on FreezingBlue Flashcards.

  1. Name some output devices?
    • Screen displays
    • Process control devices
    • The network
    • Printers
    • Flash memory (input & output)
    • Hard drives (input & output)
  2. Describe pipelining
    Pipelining involves overlapping the various stages of execution.  If an instruction consists of two stages, fetch and execute,one the instruction has been fetched and execution has begun the processor would begin fetching the next instruction.
  3. What are 4 properties of a system?
    • Accomplish a specific function.
    • May have inputs.
    • Consists of independent parts.
    • Produce outputs.
  4. What are some things that might disrupt the normal sequential flow of program execution causing control to be transferred to an exception interrupt handler?
    • Unexpected situations occuring in a program (exceptions) such as:
    • Division by 0
    • An arithmetic overflow or underflow
    • Illegal memory reference
    • System call.
    • Or a Hardware Interupt:
    • Completion of a disk i/o operation
    • Program completion (hardware interrupt).
  5. What are the fields(parts) of a machine language instruction?
    • Op-code - describes the operation.
    • Operand specifier - describes what the data operates on, will have zero or more.
  6. Which of the following are important to business systems analysis and design?
    Name 3.
    • The organization and documentation of a business system.
    • Development and goals of automated business systems.
    • Tools commonly used in the development of a business system.
  7. What are some of the functions that an operating system performs?
    • Runs and controls the hardware directly.
    • Provides for efficient use of hardware resources.
    • Provides an interface for application programs
    • Provides an interface for users.
    • Manages network functions.
    • Provides a safe and secure environment.
  8. What is the goal of cache memory and what are some of the advantages?
    • Cache is faster than main memory.
    • Cache improves memory performance.
    • Cache contains a subset of main memory.
    • * The goal is to move into cache the info from main memory that is most likely to be used by the processor.  This allows the processor to see a much faster memory access time, allowing it to get more work done.
  9. What are the 7 main parts of the instruction cycle?
    • Determine the address of the next instruction
    • Fetch the instruction from memory
    • Decode the instruction (determine what to do)
    • Fetch 0 or more operands
    • Perform (execute) the instruction
    • Store the results
    • Advance the program counter
    • *Fetch and execute are the major steps*
  10. Which of the following are Quality Assurance personnel roles?
    Name 4.
    • Defining quality metrics and test cases.
    • Developing test beds.
    • Perform regular tests and evaluation of software.
  11. A processor can be broken down into 4 sub-systems, they are?
    • Registers - temporary storage locations
    • Arithmetic logic unit(ALU) - does math
    • Control Unit - sequences the operations of the processor.
    • Internal processor interconnections
  12. What are some properties of registers?
    • Registers are temporary storage locations within processors.
    • Registers can be accessed quickly.
    • They can number less than 100.
    • Two categories: user visible & control and status.
    • Program counter is a register
    • instruction register
    • memory address register
    • memory buffer regiester
  13. 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 of the address of the instruction to be executed?
    Program counter.
  14. What are the 4 top-level systems of a computer?
    • Processing unit (CPU)
    • Main memory
    • System interconnections
    • Input/Output (I/O)
  15. What is the name of the portion of an instruction that determines what the instruction does?
  16. What are some of the functions that an operating system performs?
    • Runs and controls hardware directly
    • Provides for efficient hardware resources
    • Provides and interface for application programs
    • provides an interface for users
    • Manages network functions
    • Provides a safe and secure enviornment.
  17. What are the layers of a four tier architecture?
    • Client interface.
    • Server interface.
    • Business logic.
    • Storage.
    • *The goal is to maximize cohesion (components are related and perform similar tasks) and minimize coupling (modifying one subsystem will have little effect on others).
  18. The 3 major areas of automated business applications(IT systems) are?
    • User interactions - input & output (keyboards, displays etc...)
    • Processing of user data - implementing business logic using software.
    • Database or file access - maintaining & organizing data
  19. Describe a use case model.
    • Actors in a use case model can also be another system that interacts with the described system.
    • Inheritance relationships can be used by both actors and use cases.
    • Use case model shows the functionality of a system from the user's view.
    • Rectangular box shows the system boundary.
    • * Use case model is functional model used to express the external behavior of a system from the actor's view.  The actors can be the users of the system or the external systems that interact with the described system.  It can use communication, include, extend, inheritance to simplify the use case diagram.
  20. What are the responsibilities of a project librarian?
    Maintain online libraries of documents, programs and test materials.
  21. Describe machine language
    • Every piece of data can be represented by a series of zeros and ones.
    • Storage capacity of memory is measured in numbers of bits or bytes.
    • *The processor executes machine language instructions continuously.  Inside the processor, data and instructions are represented by the on and off positions of transistors, we represent these positions using binary (0's and 1's).  Every instruction can be represented by 0's and 1's
    • *A bit is used to represent the on/off postion of one transistor, a byte is 8 bits (it takes one byte to represent a character in the English language)
  22. Operating systems maximize processor usage by doing which of the following?
    Name 2.
    • Executing a program that isn't waiting for I/O.
    • Keeping more than one program in memory.
    • These are called multi-programming.
  23. Describe the SQL SELECT command.
    • Is a DML (data manipulation language) command.
    • Is used to retrieve table contents, this forms the basis for data queries.
    • The WHERE clause is optional in the SELECT command, used to compare different values.
    • The SELECT command is used to do a join between two tables.
    • A SELECT command can be used for specifying rows for updating.
    • The SELECT command has several optional clauses.
  24. Describe the SQL INSERT command.
    • DML command.
    • Used to insert data one row at a time.  
    • Cannot be used to change data types.  
    • Needs to be followed by a COMMIT command in order for the data to be inserted into the table.
    • May need to use a different syntax depending on the data type of the data it is inserting.
  25. What are some functions of database programs, such as PL/SQL.
    • A database program can be useful for loading a data warehouse.
    • A database programmer can write code that will execute different commands based on different conditions.  (It is possible to use conditional clauses in database programming).
    • Database programming can be useful for extending security in a database application.
  26. User privileges can be granted for:
    4 things.
    • User access to specific operations on specific tables in the database.
    • User access to specific operations on specific attributes of specific tables in the database.
    • User access to specific tables in the database.
    • User access to the entire database.
  27. What are some properties of primary keys?
    • Must have a unique value.
    • Cannot be null.
    • Can be one attribute or several attributes combined.
    • Uniquely identifies every row or record in a table.
  28. What are some properties of the SQL ALTER command?
    • DDL (data definition language)
    • Allows you to modify the data type of a column in an existing table.
    • Allows you to add a constraint to an existing table.
    • Allows you to add a new column to an existing table.
  29. In terms of an RDBMS(relational database management systems), what is metadata?
    Data definitions and relationships.
  30. What is DDL?
    • Data definition language.
    • The commands are CREATE, ALTER and DROP
    • Part of the SQL language.
    • Used to create and modify table structures.
  31. What are some properties of foreign keys?
    • Creates a relationship between two tables.
    • A foreign key in one table relates to a primary key in  different table.
    • This enforces integrity rules.
    • Must match the primary key or it must be a null value.
  32. What are the ways and RDBMS differs from a spreadsheet application?
    • Maintains transactions in logs to help recover database if there was a problem.
    • Has more sophisticated security to control access to the data in the database.
    • Can contain much more data than a spreadsheet.
  33. What are some properties DCL?
    • Data command language
    • Commands include GRANT and REVOKE.
    • Part of the way an RDBMS handles security by controlling access.
  34. What would you use to load a data warehouse?
  35. What is a tuple?
    A row of data that is related.
  36. How does an RDBMS provide data recovery?
    By splitting updates into logged transactions.
  37. What are some jobs in the Database field?
    • Database administrators need to understand the details of the particular DBMS with which they work.
    • Data administrator plans for database and technology, sets standards
  38. What are some properties of spreadsheets?
    • Spreadsheets are easier to set up and use than a relational database.
    • The data in a spreadsheet is organized by rows and columns.
  39. What are some leading RDBMS today?
    • Oracle
    • Sybase.
    • UDB.
    • MySQL.
  40. What are some properties of DML commands?
    • Data manipulation language
    • Commands are SELECT, INSERT, UPDATE & DELETE.
    • Used to update and retrieve data in the database.
  41. What are some things about data types?
    • Both spreadsheet applications and RDBMS tables include data types.
    • A number can be declared with one of several different data types.
    • BOOLEAN can be a data type.
  42. What are some of the features of the relational database model?
    • The relational model is based on mathematical theory.
    • Relational databases store data in tables, which are also termed relations.
    • A relational database includes a query language, such as SQL, for accessing and manipulating data.
  43. Message headers contain:
    • Addressing information.
    • Source and destination address.
    • Message size (may contain this).
  44. What technology is primarily used to prevent penetration attacks?
    A firewall.
  45. What organization is responsible for establishing standards that govern how the internet operates?
    Internet Engineering Task Force (IETF).
  46. What is the internet layer responsible for?
    Routing packets.
  47. Client-based architectures...
    • Puts data storage on one computer.
    • All other logic on another computer (Presentation, application, data access logics)
  48. What is the purpose of a router?
    To transfer packets from one network to another network (works on the internet layer).
  49. A web browser and the web are an example of what type of system architecture?
    • Client-server achitecture (2-tier).
    • (unlike client-based, only a portion of the file is transmitted)
  50. Describe multi-tier architectures
    • Distribute processing functions over 2 or more computers.
    • Run client/server applications.
  51. What is the dominant technology used in desktop area networks?
  52. Which of the following were important advancements made in the industry in the 1970's and 1980's that led to a new type of system architecture?
    3 things.
    • Development of microprocessors.
    • Development of inexpensive networks.
    • Development of commercial off-the-shelf sortware (COTS).
  53. Which of the following characterize cloud computing?
    Rapid scalability.
  54. A protocol data unit (PDU) contains which of the following?
    3 things.
    • Header.
    • Payload or data field.
    • Trailer (optional).
  55. What is the highest layer processed by a switch?
    Data link.
  56. What are the goals of providing network security?
    • CIA
    • Confidentiality.
    • Availability.
    • Integrity.
  57. What do protocols define?
    • Syntax (form).
    • Semantics (meaning).
    • Timing (when sent).
  58. What is a Denial of Service (DoS) attack?
    This overloads a network with so many bogus packets it does not have time to process the packets.
  59. What is contained in the header added to the protocol data unit (PDU) by the internet layer?
    Sender and receiver IP address
  60. Which protocol is used for network management?
    SNMP (simple network management protocol).
  61. What are some characteristics of Host-based architectures?
    • Put all the processing power on a single computer.
    • Time sharing.
    • Serial communication.
    • Dumb terminals.
  62. Which of the following are components of a network?
    3 things.
    • Applications
    • Message
    • Protocols
    • Sending & Receiving device
    • Communication channel.
    • Communication device.
    • Receiving device.
  63. The process of adding headers to a PDU is called?
  64. What is the 3 step programming model?
    • Edit.
    • Compile.
    • Run.
  65. In Java, what does the statement C +=a mean?
    c = c + a.
  66. What are some properties of Java String literals?
    • Appears within the parenthesis of a printin statement it will print out exactly as it appears.
    • Can contain letters of the alphabet and the digits 0 - 9.
  67. How and when are Java objects created?
    • Created by the new operator.
    • Created at execution (run) time.
    • *Classes are templates or descriptions of objects, the actual object is created at runtime but use of the new operator.
  68. Describe the programming process in Java.
    • Determining program output display.
    • Determining whatthe program is supposed to accomplish.
    • Resolving all program logic errors.
    • Developing invalid input as test data.
    • *Programmers must determine what program is supposed to accomplish, the determine the inputs and outputs of the program, design the algorithm, write the Java code, resolve all syntax and logical errors and test the program, both valid and invalid data must be defined and tested.
  69. What are the primitive data types?
    • Boolean (true/false)
    • char (single printable character)
    • double
    • float
    • int
    • long or short
    • byte
  70. Which of the following are true about a software program?
    4 things.
    • A program consists of instructions that accomplish a specific operation.
    • A set of program instructions is known as an algorithm.
    • A program consists of instructions that must be exectuted in a particular sequence.
    • A program is responsible for validating user inputs.
  71. What are the criteria for variable names?
    • 1st character must be a letter, underscore or dollar sign (these are the only characters allowed)
    • After the 1st you can use a-z, 0-9, underscore or $
    • Case matters
    • No Spaces.
  72. What is true about the Java statement public static main (String[] args)?
    • It is a method header.
    • It is always required in a Java application.
  73. If c = -2, what does a equal in the following Java statement?

    a = 2 + C++
  74. Which of the following is a valid method header for the "main" method required in each Java application?
    public static void main (Strings[] args)
  75. What are some criteria for Java language?
    • Curly braces, {}, always exist in pairs.
    • blank lines are ok
  76. Which of the following languages is interpretive?
  77. Discuss logic errors.
    • Detected by analyzing the operation of a program.
    • Detected at runtime.
    • Potentially result in incorrect program output.
  78. What are some characteristics of an algorithm?
    • Sequence of instructions.
    • Computer program constitutes and algorithm.
    • Steps must be performed in a particular order.
  79. What applies to the Eclipse Integrated Development Enviornment (IDE).
    3 things.
    • Should be installed on your system after the installation of the Java language system if you are going to use Eclipse for your IDE.
    • Facilitates the development of Java programs.
    • Is one of many IDE's which may be installed to use the java language software.
  80. Which of the following are true regarding the general description of keywords in a computer language?
    • A particular keyword is used only in particular ways in a language.
    • A particular keyword has one or more specialized meanings in the language.
    • They must be entered in lowercase.
    • *public and class are keywords*
  81. How would you declare a contant?
    final double MRATE = 3.5
  82. What is true regrarding the Java method main?
    2 things.
    • Called by the Java Virtual Machine when the program is started.
    • In the declaration of main, the term "static" means that the main method exists in memory and can  be executed without creating an object.
  83. What is true about Java?
    • A Java program runs on a Java virtual machine.
    • Java was developed for embedded applications.
  84. The Java SE language system consists of which of the following?
    • Compiler.
    • Runtime enviornment.
  85. Which iterative procedure in Java always executes the subscope of code at least once?
  86. What is true about the scanner class?
    • allows the Java program to accept an integer number from the user's keyboard.
    • allows the Java program to accept a text string from the user's keyboard.
    • found in the util package of the API library.
  87. Which of the following statements are true regarding the Java do...while statement?
    • The subscope of the loop is executed once before testing to continue the iteration.
    • The do keyword appears at the top of the loop and the while at the bottom.
    • Testing is done following the subscope of the loop.
  88. Name 4 aspects of the if statement
    • Can alter the flow of the program execution.
    • A conditional statement.
    • Followed by an open round parentheses.
    • Followed by one or more action clauses.
  89. What are the parts of an elementary conditional clause?
    • a>5
    • A conditional clause consists of 3 parts
    • 1. An operand, which is a variable
    • 2. One of 6 conditional operators (==, !=, <, <=, >, >=)
    • 3. Another operand which may be either a variable or a literal constant.
  90. What are the three forms of iterative loops in Java?
    • do...while.
    • while.
    • for.
  91. What is the outcome of the following code?
    System.out.println ("CS200");
    while (false);
    CS200 is printed once.
  92. What must a programmer do in order to print multiple items?
    Separate the items by a +.
  93. Assuming the following statements have been executed, what is stored in the answer
    int i = 7; int n = 2; int answer;
    answer = i/n;
    3 (because when integer is used the answer is 3.5, the .5 is discarded)
  94. What will the value left in i be after the following Java code is executed?
    int 1=0;
    for (int j = 0; j<5; j = j + 2)
    i += j;
  95. 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)
    6, 11, 0
  96. 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;
    30, since break is not used the code will do all case and end up at 30.
  97. What is the maximum number of subsections which could occur with the header of a Java for loop?  Subsections are bounded by round parentheses and interior semicolons.
    • 3
    • i.e. for (int j=0; j<5; j++)
  98. What are some names applied to Java programming material which is enclosed within round parentheses?
    • Conditional clauses.
    • Parameter lists.
  99. 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");
    System.out.println ("3");
  100. Assuming the following statements have been executed, what is stored in the answer?
    double i=7;
    int n = 2;
    double answer;
    answer = i/n;
    3.5 (the int variable is cast to double and the 0.5 is kept)
  101. What is the purpose of the ! sign in a conditional clause?
    • Reverses the logical sense of a conditional clause.
    • Negates an equals sign (i.e. !=, means not equal to).
  102. 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)
    6, 11, 17
  103. What are the two main components of an iterative loop in Java?
    • A subordinate scope of the program code(block of code).
    • The evaluation of a boolean expression yielding either true or false(test).
  104. What do a + (plus) sign mean when it is associated with two Java strings?
    The second string is appended to the end of the first string.
  105. What will be printed by the following Java program?
    for (int i=1; i<3; i++)
    System.out.print ("Row ");
    System.out.print (i);
    System.out.print (" Your Boat");
    • This program would not compile
    • Because i is only contained in the for statement and not outside.
  106. What are some true statement about arrays in Java?
    • Collection of variable which are accessed individually by using the name of it reference variable and an index
    • Collection of variables which all share the same name.
    • First variable index begins at 0.
    • Derived data type
  107. Given the array,
         int[] values = {0,1,2,3,4,};
    what is the value of the expression:
         values[1] + values [5]?
    This would return an error since value #5 does not exist, the array index begins with zero and would go through 4 to give a total of 5 values.
  108. Given the array,
         int[] values = {0,1,2,3,4,};
    what is the value of the expression:
         values[1] + values [2]?
    3 (Value 1=1, value 2=2)
  109. What is the index of the first element of an array in Java?
  110. Which of the following is true in a correct implementation of recursive method definition?
    A base condition is required so that the recursive method will terminate after a finite number of invocations.
  111. What statement or expressions would allow a Java program to display the length of array Infant_Age[] = {1,2,3,4}?
    System.out.print (Infant_age.length)
  112. How do we determine if sport1 is the same as sport2?
    String sport1 = new String ("Soccer");
    String sport2 = new String ("Tennis");
    if (sport1.equals (sport2))
  113. What are some properties of recursion as used in computer programming?
    • Recursion is a type of repetitious procedure.
    • The execution of a recursive procedure is governed by the evaluation of conditional clause.
    • Recursion is a programming procedure which is capable of calling itself.
    • The execution of a recursive procedure is governed by the evaluation of a conditional clause, and the conditional clause is called the base condition.
  114. What are some aspects of the definition of an array in Java?
    • The array itself will exist in the Heap.
    • The definition of an array may also include specific values to be stored in elements of the array.
    • The array definition may not actually create the array.
    • The name of the reference variable for an array may be followed by a pair of square brackets and an equal sign.
  115. What is true regarding a Java method?
    • method headers must include the data type for each parameter.
    • the scope of a local variable defined with a Java method is within the method.
    • Arguments to Java methods are passed by value.
  116. What is the purpose of the [] operator
    3 things.
    • Enclose a count of array members.
    • specify that the preceding variable is an array.
    • Enclose an expression which evaluates to an array index
    • *They do not enclose scopes.
  117. What is the expression to allow a Java program to access the length of array A?
  118. What is a valid declaration of an array in Java?
    • int a[] = new int[10]
    • double b[] = {1.23, 2.34, 3.45}
  119. Given the array,
         int[] values = {0,1,2,3,4,};
    what is the value of the expression:
  120. What are some valid string declarations?
    • String todaysWeather = "Rain";
    • String todaysWeather = new String ("Rain");
    • *not* int todaysWeather[] = {"R", "a", "i", "n"} arrays are not valid ways to declare strings.
  121. What are some true statements about:
        String todaysWeather = new String ("Rain");
    • "Rain" resides in the memory heap for the program.
    • todaysWeather is a reference variable.
    • todaysWeather contains the address in memory of the String object.
    • todaysWeather is a variable name.
  122. Given the following recursive method:
    public static int doSum (int n)
    if (n<=0)
    return 0;
    return 1+ doSum(n-1);
    What is the value of the expression doSum(5)?
    5, the result is 1+1+1+1+1+0 = 5
  123. What will be printed by the following program?
    int 1;
    for (i=0; i<3; i++)
    System.out.print (i);
    System.out.print (i+1);
  124. 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 statement shown below produce what output?
    int a = -10, int b = -20, int sum = doSum (a,b);
    System.out.print (a +, "," + b + "," + sum);
    • -10, -20, 30
    • because of scope a&b are only changed within doSum, not outside, so when print is called the values of a&b are still the same, but the sum = doSum which was positive.
  125. A project plan document provides scheduling of various tasks and personnel such as:
    • Establishing the order in which the tasks of the project will be accomplished.
    • Acquisition of external consultants.
    • Acquisition of appropriate computing facilities
    • Assignment of in-house personnel.
  126. What are the 4 major levels of automated business applications?
    • individual
    • intermediate
    • enterprise
    • global
  127. What are some important things to business analysis systems and design?
    • Types of personnel involved in the development of a business system.
    • basics of business systems architectures
    • Types of tasks involved in the development of a business system.
  128. What are some types of application software?
    • Productivity software.
    • Tax prep software.
    • Personal information management software.
    • Project Management Software.
    • Financial and Tax Software.
    • Web Authoring.
    • Music and Audio.
    • Image processing.
    • Software Development.
    • Educational.
    • Desktop Publishing.
    • CAD.
  129. What type of memory contains boot code which is necessary to get the computer started the power up?
  130. Which of the following accurately describe people involved in the development of the systems?
    3 people
    • A system builder is a stakeholder.
    • System designers choose the technology for a new system.
    • A systems analyst considered the team leader, should be good at problem solving and getting people to work together.
  131. What are some things that are true regarding machine language and data representation in a computer system?
    • Binary number system is used to represent data and instructions in machine language.
    • Processor executes machine language instructions continuously
    • There are 8 bits in a byte.
  132. The normal flow of sequential instruction execution within a program can be altered as a result of:
    • An exception
    • An interrupt
  133. Information technology is the practice of using computer hardware and software to provide:
    3 things
    • Solutions to business-oriented problems
    • Business system conversions
    • Technologies for business support
  134. A PERT chart is used to establish the order in which various IT project____ are completed.
  135. What describes databases in an organization?
    Today many organizations use IT activities such as data mining to streamline their operations and achieve competitive advantage.
  136. How do you create a table in SQL?
    • CREATE TABLE Table_name (column_specifications)
    • The command CREATE TABLE creates the table structure (you'll need to use INSERT command to add data to the table)
  137. What is true regarding an RDBMS vs spreadsheet application?
    An RDBMS supports indexes to quickly find data items, while a spreadsheet does not.
  138. What is true about creating a join?
    1 thing.
    The RDBMS requires the column names in a join to be prefixed by the table name
  139. What is true about data in spreadsheets?
    3 things.
    • Each of the rows usually represents data about a particular entry.
    • Assumes a data type based on the first value you type into a cell.
    • Multiple values can be entered into a cell of a spreadsheet.
  140. What is true about the DROP TABLE command?
    • Once a table is dropped, it no longer exists in the system catalog
    • Is a DDL command.
    • *DROP TABLE is a DDL command that deletes the table and all of the table data, once dropped it no longer exists, does not have an optional clause because it is an all or nothing operation.
    • *Different from the DELETE command, DELETE only allows you to delete the data in a table.
  141. What is true about primary and foreign keys in an RDBMS table?
    Both primary and foreign keys play roles in referential integrity.
  142. What is true about the SQL language?
    • Can define access rights to the database.
    • Allows you to access and manipulate data in databases.
  143. What is true about the UPDATE command?
    • UPDATE Table
    • SET field
    • Where condition

    • After using, you'll need to use a SELECT command to see the changes.
    • * the WHERE clause is optional, but SET is required.
    • *UPDATE is a DML command.
  144. What is the transport layer responsible for?
    the end to end communication between the source and final destination entities.
  145. What is the dominant technology used in local area networks?
  146. What are some characteristics of protocols?
    • Connectionless vs Connection oriented
    • Reliable vs. Unreliable
  147. A repeater is a device used at which of the layers in the internet model?
    • Physical - Repeater
    • Data Link - Switch
    • Internet - Router
  148. What components are necessary for a WLAN?
    • Wireless access point.
    • Access card (usually built in)
  149. The five layer hybrid OSI/TCP/IP (or internet) model includes which of the following layers?
    What is the PDU called at each of these layers?
    • 1. Application (Message)
    • 2. Transport (Segment)
    • 3. Internet (Packet)
    • 4. Data link (Frame)
    • 5. Physical (bits)
  150. What is the highest layer processed by a router?
  151. What network architecture does cloud computing utilize?
    Multitier (n-tier)
  152. What is the physical layer responsible for?
    Representing bits (1 & 0) on the media.
  153. What is true regarding interpreters?
    • The source code and the executable file are the same.
    • They recompile each statement every time the program runs.
    • They use a two step approach that combines the compile and run steps into one step.
    • *Interpretive languages, such as BASIC, translate and execute each statement as they come to it.
  154. What does a Java compiler generate?
  155. What are the derived data types in Java?
    • String
    • [] - (array)
  156. What are some characteristics about Java assignment statements?
    • consist of a variable
    • = operator
    • and possibly and arithmetic expression
  157. How would you write code to swap variables x & y?
    • make a temp variable t
    • 1. t=x
    • 2. x=y
    • 3. y=t
  158. What is a Java Virtual Machine?
    JVM is a language run-time enviornment.
  159. In Java , the expression:
         5-10-5/2 gives:
    • -7
    • In Java constants are stored in integer format so 5/2 gives 2 and then 5-10-2=-7
    • If any of the numbers had been expressed with a decimal 5.0/2 = 2.5.
  160. What are the ranges for:
    char n
    • integers extend to over 2 billion
    • booleans are true/false (not yes)
    • short is an integer
    • char n is null
  161. What type of statement is:
        average = (x+y)/2.0
    Assignment statement which assigns a value to the variable called average
  162. What is a void method in Java?
    Returns no data
  163. What does an Interactive Development Enviornment (IDE) contain.
    • Editor (Edit)
    • Language compiler (Compile)
    • run-time enviornment (Run)
  164. Given the following declarations:
       int x=10, y=11;
    the expression (x+y)/2 gives:
  165. What is a valid header for a Java for Statement?
    • for (count=1, sum=2; count <=5; count++, sum++)
    • for (count=1; count <=5; count++)
    • for (; count <=5;)
    • * need 3 fields seperated by semicolons, the 2nd field is the only required field.
    • * if more than one field appears in the 1st or 3rd columns they need to be seperated by columns.
  166. What happens if the break statement is left out of a case section in a switch statement in Java?
    Once the last statement in the case section is executed control will flow into the next case section.
  167. What is the outcome of the following code?
    int a=10;
    int b=20;
    System.out.println ("Result = " + a + b)
    Result = 1020
  168. What are the conditional operators?
    • ==
    • !=
    • <
    • <=
    • >
    • >=
  169. What is the outcome of the following code?
    int a=5, b=10, sum=0
    if ((a++==50||(b++==10))
    sum = a + b
    System.out.println (a + "," + b + "," + sum);
    • 6, 10, 16
    • * Since a is equal to 5 the 2nd condition is not evaluated and b remains unchanged, but a is changed to 6 so, 6+10=16.
  170. What is the outcome of the following code?
    int a=5, b=10, sum=0
    if ((++a==50&&(b++==10))
    sum = a + b
    System.out.println (a + "," + b + "," + sum);
    • 6, 10, 0
    • * Since the ++ is before a, it is incremented and then checked so 6 is not equal to 5, therefore the second part is not checked, nor is the sum command performed.
  171. In what sense are iterative procedures repetitious?
    They process the same subordinate scope of the program code again and again until a condition is fulfilled.
  172. What are some things that are true about the do...while iterative loop in Java?
    • Only iterative loop which requires two keywords to manage it.
    • The conditional clause which governs the exectution of a do...while loop is a standard conditional clause like any which occur in other conditional statements.
    • The only type of iterative loop in which the terminating semicolon immediately follows the closing round parentheses which enclose it conditional clause.
  173. What are some things terminated by a semi-colon in Java?
    • Variable declaration statements
    • executable statements
    • assignment statements
  174. What are some characteristics of arrays
    • Once declared, the length is fixed for the rest of the program execution
    • The data in an array can either be primitive or derived
    • All elements of the array must be the same data type.
  175. Given the definition of the array B as follows:
       double B[] = new double[5], what would the expression b.length retrieve?
  176. How would you tell if two strings have the same name?
    if (stringname1.equals (stringname2))
  177. What are two ways to allocatte 5 members to the double array B?
    • double B[]={1,2,3,4,5};
    • double B[] = new double[5];
  178. How would you find the length of string X
    • X.length()
    • * X.length finds the length of an array
  179. What are some types of variables that are dependent on their usage in Java
    • Local Variables - only available to individual methods
    • Instance variables  - defined only for a class and are only available to methods of the class.
    • Formal parameters - only used within local methods
    • Reference variables - contain values which point to other variables or objects.
  180. Which Java procedure may never execute its subscope?
    • for
    • while
    • * do...while will always do the subscope at least once.
  181. Given the following recursive method, what is the value of the expression sum(3)?
    if (n==1)
      return 1;
      return n + sum(n-1);
    • 6
    • * first pass 3 + sum(2)
    • * 2nd pass 3 + 2 + sum(1)
    • * 3rd pass 3+2+1=6
  182. What Java syntax is required to support recursion?
    • Calls to a function
    • Formal parameters and actual parameters
    • The if statement.
    • * other functions may be useful, but these are necessary.
  183. What happens when an object is created?
    • A method with the same name as the class is sometimes executed within the object.
    • A reference to the object is returned.
    • Instance variables are initialized
    • A constructor is executed.
  184. What does the private keyword do?
    Access modifier which enforces that the value of the variable is only accessible from within the class.
  185. If an instance variable is declared as private how can its value be changed?
    • With a constructor.
    • By invoking a mutator method.
    • By a method within the object.
  186. If we have multiple constructors for a given class, which one will be executed when an object is created?
    • We will specify the unique signature of the constructor we want.
    • A class can have multiple constructors, as long as their signatures (parameter list) vary.
  187. What are some things that are true about constructors?
    • Have the same name as the class.
    • There can be many within a single class.
    • Executed when an object is created.
    • Often used to initialize instance variables.
    • If one is not defined the default constructor is executed.
  188. Once an object is created, how is a method invoked with that object?
    • By using the reference variable and the method name.
    • i.e. c.computeArea.
  189. When an object is created, the actual variables associated with the object are called?
    Instance variables.
  190. Objects are created from classes by using which operator?
  191. What are some properties of class inheritance?
    • Objects are always created from the base class.
    • Multiple classes share characteristics from a base class.
    • The keyword to indicate inheritance is extends.
    • Common characteristics are defined in the base class.
    • Attributes and methods can be added to the derived class.
  192. What are some features of object-oriented programming?
    • Focus on the creation of objects.
    • Objects contain both data (attributes) and procedures (methods).
    • Private data is encapsulated.
  193. What are some things about the child class?
    • Parent class contains all the common attributes and methods.
    • Objects are created from the child class, not the parent.
  194. What is the toString method?
    • Automatically printed when an object is printed
    • It returns a string constructed withing the method.
  195. What are some things about creation of an object?
    • Objects are instantiated from classes.
    • Attributes in an object contain specific values.
    • Once attributes in an object are initialized all methods withing the object have access to that data.
    • It is possible to have many objects from the same class
  196. How are instance variables hidden within an abject so they cannot be referenced from outside the object?
    They are declared as private.
  197. What are some properties about Java classes?
    • Define methods and attributes.
    • Blueprint of the description of an object.
  198. What are some properties of the procedural programming paradigm?
    • All data was centralized.
    • Programs were a series of procedures.
    • Data was passed back and forth among procedures.
    • Data was separate from code.
  199. Classes encapsulate...
    • Definitions of the data.
    • Instance variables.
    • Behavior
    • Methods.
  200. What are some disadvantages of procedural programming.
    • If data is changed all procedures that reference that data must be changed.
    • If data becomes corrupt, it is difficult to determine what code corrupted the data.
    • It is difficult to share or reuse procedures.
  201. How can instance variables have their values established?
    • By a constructor.
    • Mutator methds.
    • Code from within the object.
  202. What does a Java class definition contain?
    • Instance variables.
    • Constructors.
    • Get and Set methods.
    • Computation methods.
  203. What is the formula of the quadratic equation?
    -b+/- sqrt(b2 -4ac) / 2a
Card Set:
BU CS200 Final
2014-04-25 18:54:46
computer science

BU CS200
Show Answers: