Lesson 6 and 7 Exam

docx

School

Ashworth College *

*We aren’t endorsed by this school

Course

K08D1LG

Subject

Computer Science

Date

Jan 9, 2024

Type

docx

Pages

13

Uploaded by PrivateIronPorcupine45

Report
Question 1 2.5 / 2.5 points Which of the following statements is FALSE? Question options: A finally block, if there is one, is placed after the last catch block. A finally block should release all resources acquired in the corresponding try block. The finally block and try block can appear in any order. A finally block is optional. Question 2 0 / 2.5 points What's the difference between a try block and a try statement? Question options: There is no difference; the terms can be used interchangeably. A try statement refers to the block of code following the keyword try, while the try block refers to the try keyword and the block of code following this keyword. The try block refers to the keyword <strong>try </strong> followed by a block of code. The try block and its corresponding catch and/or finally clauses together form a try statement. The try statement refers to the keyword try followed by a block of code. The try statement and its corresponding catch and/or finally clauses together form a <strong>try </strong> block. Question 3 0 / 2.5 points According to the flow of control for exceptions, if the following try block throws an error by attempting to divide by zero, which of the following values will be written to the console? try { Console.WriteLine ("A"); } catch (Exception e) { Console.WriteLine ("B"); }
catch (DivideByZeroException divByZeroExc) { Console.WriteLine ("C"); } catch (FormatException formatException) { Console.WriteLine ("D"); } Question options: &quot;A&quot; &quot;B&quot; &quot;C&quot; &quot;D&quot; Question 4 2.5 / 2.5 points According to the flow of control for exceptions, if the following try block throws an error by attempting to divide by zero, which of the following values will be written to the console? try { \\ some algorithm here Console.WriteLine ("A"); } catch (FormatException formatException) { Console.WriteLine ("B"); } catch (DivideByZeroException divByZeroExc) { Console.WriteLine ("C"); }
catch (Exception e) { Console.WriteLine ("D"); } Question options: &quot;A&quot; &quot;B&quot; &quot;C&quot; &quot;D&quot; Question 5 2.5 / 2.5 points An exception object has several properties, including the __________ property, which provides the name of the application or object that caused the exception. Question options: HelpLink InnerException Source TargetSite Question 6 2.5 / 2.5 points In C#, after an exception is handled, control resumes __________. This is known as the __________ model of exception handling. Question options: after the last catch block; termination after the last catch block; resumption just after the throw point; termination just after the throw point; resumption Question 7 2.5 / 2.5 points
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
An exception object has several properties, including the __________ property, which specifies the method where the exception originated. Question options: HelpLink InnerException Source TargetSite Question 8 2.5 / 2.5 points Writing code to handle an exception, should it occur, is the process of __________ an exception. Question options: blocking logging catching breaking Question 9 2.5 / 2.5 points An exception object has several properties, including the __________ property, which provides the location of a help file relevant to the particular exception. Question options: HelpLink InnerException Source TargetSite Question 10 0 / 2.5 points Which of the following statements about try blocks is TRUE? Question options: The try block must be followed by at least one catch block.
The try block must be followed by a finally block. The try block should contain statements that may process an exception. The try block should contain statements that may throw an exception. Question 11 2.5 / 2.5 points Exception handling offers the ability to always execute a block of code regardless of whether a corresponding try executes properly. This code can be placed in a __________ block. Question options: finally try resource throw Question 12 2.5 / 2.5 points Which of the following statements is TRUE? Question options: The throw statement is used to throw an exception. The throw statement is used to specify that a method will throw an exception. The throw statement is used to access an exception parameter. All of the above Question 13 2.5 / 2.5 points In your applications, you can choose to __________ an error, which will provide an exception to the compiler to indicate that a problem occurred. Question options: triage log break throw
Question 14 0 / 2.5 points Which of the following statements about try blocks is TRUE? Question options: The try block must be followed by at least one catch block. The try block must be followed by a finally block. The try block should contain statements that may process an exception. The try block should contain statements that may throw an exception. Question 15 0 / 2.5 points If a programmer needs to convert a string value to a numeric value, such as an integer, the generally preferred way to do this is to use the integer's __________ method. Question options: TryParse TryInt Try Swap Question 16 2.5 / 2.5 points If an exception is thrown in a catch handler, any code in the handler that follows the thrown exception will: Question options: generate a syntax error. generate a logic error. never be executed. run after the finally block is done. Question 17 2.5 / 2.5 points A try/catch statement can have several catch blocks. You can choose to not specify a specific type of exception in a catch, which is known as a(n) __________ catch clause.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question options: general exception try finally Question 18 0 / 2.5 points When prompted by the IDE for an encountered exception, you can click the __________ button to pause the program at the line where the exception occurred. Question options: Break Continue Pause Run Question 19 2.5 / 2.5 points User-defined exceptions should be derived from the __________ class. Question options: ApplicationException ConsoleException Exception SystemException Question 20 0 / 2.5 points In programming speak, when an error is encountered and an exception occurs, it is said to be: Question options: thrown. caught. tethered.
final. Question 21 2.5 / 2.5 points An object of a subclass of __________ is used to manage the data flow between your program and the database. Question options: DataFlow DatabaseContext DbContext EntityDataModel Question 22 2.5 / 2.5 points A column in one table that matches with a primary key in another table to relate the data is known as a __________ key. Question options: primary foreign DbContext composite Question 23 2.5 / 2.5 points The extension method __________ is used to filter the results of a LINQ query. Question options: Filter Equals Where None of the above Question 24 2.5 / 2.5 points
What does the "L" stand for in SQL? Question options: Large Language Linguistic LINQ Question 25 2.5 / 2.5 points With the Entity Framework, you interact with a database via classes generated by the IDE. This is all done by generating an Entity Data: Question options: Framework. Relational Database. Context. Model. Question 26 2.5 / 2.5 points Database tables organize data in rows and columns. Rows are also referred to as: Question options: entities. fields. records. data. Question 27 2.5 / 2.5 points The BindingNavigator allows the user to: Question options: control which row of the table is currently in view. add new and delete new rows.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
save changes to the data in view. All of the above Question 28 2.5 / 2.5 points What does the "Q" stand for in SQL? Question options: Queries Queryable Query Quotient Question 29 2.5 / 2.5 points DBExtensions method Load loads: Question options: an entire database's data into a DbContext. the specified data—typically a specific table or the result of a LINQ to Entities query. other records of the same relational database table, making it easier to manipulate. classes to represent each table in the database and classes to represent the rows of each table in the database. Question 30 2.5 / 2.5 points Every row in a database table must be unique in some way. A __________ key is a single column that defines what is unique in that row. Question options: primary foreign DbContext composite
Question 31 2.5 / 2.5 points A __________ database organizes data in tables. Question options: structured entity-driven model-driven relational Question 32 0 / 2.5 points A relational database model allows relationships between data to be considered without concern for the __________ of the data. Question options: meaning structure application All of the above Question 33 2.5 / 2.5 points An ADO.NET Entity Data Model contains: Question options: classes to represent each table in the database. classes to represent the rows of each table in the database. only classes that represent the database's tables. Both a and b Question 34 2.5 / 2.5 points A database's table, table fields, and the relationships among all the tables are collectively known as the database: Question options:
entity. DBMS. schema. SQL. Question 35 2.5 / 2.5 points Using LINQ to communicate with a disparate data source such as a database is known as LINQ to: Question options: Entities. Objects. Databases. XML. Question 36 2.5 / 2.5 points A primary key must be unique for each __________ in the relational database table. Question options: field data set record structure Question 37 2.5 / 2.5 points What does the "S" stand for in SQL? Question options: Syntax Structured Solitary Selected
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 38 0 / 2.5 points In a database table, a column can be defined as an __________ column, which can be a numeric value that autoincrements for each record in the table. Question options: identity autoincremental integer entity Question 39 2.5 / 2.5 points Database tables organize data in rows and columns. Columns are also referred to as: Question options: entities. fields. records. data. Question 40 2.5 / 2.5 points A __________ object manages the data flow between an application and a database using the Entity Framework. Question options: table field DbContext row