MTA Quiz Software Part 1 - Maysa Hassan

47 Questions

Settings
Please wait...
MTA Quiz Software Part 1 - Maysa Hassan

MTA certifications are a great place to start if you would like to get into the technology field. MTA certifications address a wide spectrum of fundamental technical concepts, assess and validate core technical knowledge, and enhance technical credibility. Give the software quiz below a test to gauge how conversant you are on softwares.


Questions and Answers
  • 1. 
    • A. 

      Flowchart

    • B. 

      Decision table

    • C. 

      C# programme

    • D. 

      A paragraph in English

  • 2. 
    Which of the following languages is not considered a high-level programming language?
    • A. 

      C#

    • B. 

      Visual Basic

    • C. 

      Common Intermediate Language

    • D. 

      C ++

  • 3. 
    You are writing code for a business application by using C#. Write the following statement to declare an array:int[] numbers = { 1, 2, 3, 4, 5, };Now, you need to access the second item in this array (the number 2). Which of the following expression should you use?
    • A. 

      Numbers[0]

    • B. 

      Numbers[1]

    • C. 

      Numbers[2]

    • D. 

      Numbers[3]

  • 4. 
    You are writing a method namedPrintReportthat doesn't return a value to the calling code. Which keyword should you use in your methoddeclaration to indicate this fact?A
    • A. 

      Void

    • B. 

      Private

    • C. 

      Int

    • D. 

      String

  • 5. 
    You need to provide complex multi-way branching in your C# program. You need to make sure that your code is easy to read and understand. Which ofthe following C# statements should you use?
    • A. 

      Casr

    • B. 

      Break

    • C. 

      If-else

    • D. 

      Switch

  • 6. 
    You are developing a C# program that needs to perform 5 iterations. You write the following code:01: int count = 0;02: while (count <= 5)03: {04: Console.WriteLine("The value of count = {0}", count);05: count++;06: }When you run the program, you notice that the loop does not iterate five times. What should you do to make sure that the loop is executed exactly fivetimes?
    • A. 

      Change the code in line 01 to int count = 1;

    • B. 

      Change the code in line 02 to: while (count == 5)

    • C. 

      Change the code in line 02 to while (count >= 5)

    • D. 

      Change the code in line 05 to ++count;

  • 7. 
    You are developing a C# program. You write the following code line:int x = 6 + 4 * 4 / 2 - 1;What will be the value of the variablexafter this statement is executed?
    • A. 

      13

    • B. 

      19

    • C. 

      20

    • D. 

      14

  • 8. 
    You are writing a C# program that needs to manipulate very large integer values that may exceed 12 digits. The values can be positive or negative.Which data type should you use to store a variable like this?
    • A. 

      Int

    • B. 

      Float

    • C. 

      Double

    • D. 

      Long

  • 9. 
    You have written a C# method that opens a database connection by using theSqlConnectobject. The method retrieves some information from the database and then closes the connection. You need to make sure that your code fails gracefully when there is a database error. To handle this situation ,  you wrap the database code in a try-catch-finallyblock. You use two catch blocks—one to catch the exceptions of typeSqlException and the second to catch the exception of type Exception. Which of the following places should be the best choice for closing theSqlConnectionobject?
    • A. 

      Inside the try block, before the first catch block

    • B. 

      Inside the catch block that catches SqlException objects

    • C. 

      Inside the catch block that catches Exception objects

    • D. 

      Inside the finally block

  • 10. 
    You are assisting your colleague in solving a compiler error that his code is throwing. Following is the problematic portion of his code:try{bool success = ApplyPicardoRotation(100, 0);// additional code lines here}catch(DivideByZeroException dbze){//exception handling code}catch(NotFiniteNumberException nfne){//exception handling code}catch(ArithmeticException ae){//exception handling codewww.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn}catch(OverflowException oe){//exception handling code}To remove the compilation error, which of the following ways should you suggest to rearrange the code ?
    • A. 

      Try { bool success = ApplyPicardoRotation(100, 0); // additional code lines here } catch(DivideByZeroException dbze) { //exception handling code } catch(ArithmeticException ae) { //exception handling code } catch(OverflowException oe) { //exception handling code }

    • B. 

      Try { bool success = ApplyPicardoRotation(100, 0); // additional code lines here } catch(DivideByZeroException dbze) { //exception handling code } catch(Exception e) { //exception handling code } catch(OverflowException oe) { //exception handling code }

    • C. 

      Try { bool success = ApplyPicardoRotation(100, 0); www.vceplus.com - Website designed to help IT pros advance their careers - Born to Learn // additional code lines here } catch(DivideByZeroException dbze) { //exception handling code } catch(NotFiniteNumberException nfne) { //exception handling code } catch(OverflowException oe) { //exception handling code } catch(ArithmeticException ae) { //exception handling code }

    • D. 

      Try { bool success = ApplyPicardoRotation(100, 0); // additional code lines here } catch(DivideByZeroException dbze) { //exception handling code } catch(NotFiniteNumberException nfne) { //exception handling code } catch(Exception e) { //exception handling code } catch(ArithmeticException ae) { //exception handling code }

  • 11. 
    You are developing a C# program. You write the following code:int i = 6;do{if (i == 3)break;Console.WriteLine("The value of i = {0}", i);i++;}while (i <= 5);How many times will the control enter the while loop?
    • A. 

      0

    • B. 

      1

    • C. 

      2

    • D. 

      3

  • 12. 
    • A. 

      5 percent

    • B. 

      10 percent

    • C. 

      15 percent

    • D. 

      20 percent

  • 13. 
    • A. 

      720

    • B. 

      120

    • C. 

      24

    • D. 

      6

  • 14. 
    You are writing a C# program that needs to iterate a fixed number of times. You need to make sure that your code is easy to understand and maintaineven when the loop body contains complex code. Which of the following C# statements provide the best solution for this requirement?
    • A. 

      While

    • B. 

      For

    • C. 

      Foreach

    • D. 

      Do-while

  • 15. 
    You created a class named GeoShape. You defined a method called Areain the GeoShape class. This method calculates the area of a geometric shape. You want the derived classes of  GeoShapeto supersede this functionality to support the area calculation of additional geometric shapes. Whenthe method Area is invoked on a GeoShape object, the area should be calculated based on the runtime type of the GeoShape object. Which keyword should you use with the definition of the Area method in the GeoShape class?
    • A. 

      Abstract

    • B. 

      Virtual

    • C. 

      New

    • D. 

      Overrides

  • 16. 
    Suppose that you defined a class Scenario that defines functionality for running customized pivot transform on large data sets. You do not want the functionality of this class to be inherited into derived classes. What keyword should you use to define the Scenario class?
    • A. 

      Sealed

    • B. 

      Abstract

    • C. 

      Abstract

    • D. 

      Internal

  • 17. 
    You are writing code for a class named Book . You should be able to get a list of all books sorted by the author’s last name. You need to write code to define this behavior of a class. Which of the following class elements should you use?
    • A. 

      Method

    • B. 

      Property

    • C. 

      Event

    • D. 

      Delegate

  • 18. 
    Suppose that you are writing code for a class named Product. You need to make sure that the data members of the class are initialized to their correct values as soon as you create an object of the Product class. The initialization code should always be executed. What should you do?
    • A. 

      Create a static method in the Product class to initialize data members.

    • B. 

      Create a constructor in the Product class to initialize data members.

    • C. 

      Create a static property in the Product class to initialize data members

    • D. 

      Create an event in the Product class to initialize data members.

  • 19. 
    You are creating a new class named Polygon. You write the following code class Polygon : IComparable{public double Length { get; set; }public double Width { get; set; }public double GetArea(){return Length * Width;}public int CompareTo(object obj){// to be completed}}You need to complete the definition of the Compare To method to enable comparison of the Polygon objects. Which of the following code segments should you use?
    • A. 

      Public int CompareTo(object obj) Polygon target = (Polygon)obj; double diff = this.GetArea() - target.GetArea(); if (diff == 0) return 0; else if (diff > 0) return 1; else return -1; } { Polygon target = (Polygon)obj; double diff = this.GetArea() - target.GetArea(); if (diff == 0) return 0; else if (diff > 0) return 1; else return -1; }

    • B. 

      Public int CompareTo(object obj) { Polygon target = (Polygon)obj; double diff = this.GetArea() - target.GetArea(); if (diff == 0) return 1; else if (diff > 0) return -1; else return 0; }

    • C. 

      Public int CompareTo(object obj) { Polygon target = (Polygon)obj; if (this == target) return 0; else if (this > target) return 1; else return -1; } if (this == target) return 0; else if (this > target) return 1; else return -1; }

    • D. 

      Public int CompareTo(object obj) { Polygon target = (Polygon)obj; if (this == target) return 1; else if (this > target) return -1; else return 0; }

  • 20. 
    You are writing code for a new method named Proces :void Draw(object o){}The code receives a parameter of type object . You need to cast this object into the type Polygon . At times, the value of  o  that is passed to the method might not be a valid Polygon value. You need to make sure that the code does not generate any System.InvalidCastException errorswhile doing the conversions. Which of the following lines of code should you use inside the Draw method to accomplish this goal
    • A. 

      Polygon p = (Polygon) o;

    • B. 

      Polygon p = o is Polygon;

    • C. 

      Polygon p = o as Polygon;

    • D. 

      Polygon p = (o != null) ? o as Polygon : (Polygon) o;

  • 21. 
    You are developing a C# application. You create a class of the name Widget . You use some third-party libraries, one of which also contains a class of the name Widget . You need to make sure that using the Widget class in your code causes no ambiguity. Which C# keyword should you use to address this requirement?
    • A. 

      Namespace

    • B. 

      Override

    • C. 

      Delegate

    • D. 

      Class

  • 22. 
    • A. 

      10

    • B. 

      20

    • C. 

      30

    • D. 

      40

  • 23. 
    You are developing a C# application. You need to decide whether to declare a class member as static. Which of the following statements is true about static members of a class?
    • A. 

      You can use the this keyword reference with a static method or property

    • B. 

      Only one copy of a static field is shared by all instances of a class.

    • C. 

      Static members of a class can be used only after an instance of a class is created.

    • D. 

      The static keyword is used to declare members that do not belong to individual objects but to a class itself.

  • 24. 
    You are C# developer who is developing a Windows application. You develop a new class that must be accessible to all the code packaged in the same assembly. Even the classes that are in the same assembly but do not directly or indirectly inherit from this class must be able to access the code. Any code outside the assembly should not be able to access the new class. Which access modifier should you use to declare the new class?
    • A. 

      Public

    • B. 

      Protected

    • C. 

      Private

    • D. 

      Internal

  • 25. 
    You are C# developer who is developing a Windows application. You need to provide a common definition of a base class that can be shared by multiple derived classes. Which keyword should you use to declare the new class?
    • A. 

      Virtual

    • B. 

      Sealed

    • C. 

      Interface

    • D. 

      Abstract

  • 26. 
    • A. 

      Rectangle r = (Rectangle) o;

    • B. 

      Rectangle r = o;

    • C. 

      Rectangle r = o as Rectangle;

    • D. 

      Rectangle r = o is Rectangle;

  • 27. 
    You are C# developer who is developing a Windows application. You need to provide derived classes the ability to share common functionality with base classes but still define their own unique behavior. Which object-oriented programming concept should you use to accomplish this functionality?
    • A. 

      Encapsulation

    • B. 

      Abstraction

    • C. 

      Polymorphism

    • D. 

      Inheritance

  • 28. 
    Arrange the various activities of an application lifecycle in the order in which they are likely to occur.
    • A. 

      Requirements analysis, design, coding, testing, and release

    • B. 

      Design, requirements analysis, coding, testing, and release

    • C. 

      Release, requirements analysis, coding, testing, and design

    • D. 

      Requirements analysis, design, release, coding, and testing

  • 29. 
    You are planning to develop a new software system for your organization. You need to review the plans, models, and architecture for how the software will be implemented. Of which of the following activities should you review the output?
    • A. 

      Requirements analysis

    • B. 

      Design

    • C. 

      Coding

    • D. 

      Testing

  • 30. 
    You are planning to develop a new software system for your organization. You need to review the system’s technical blueprint. Which of the following participants is responsible for providing the technical blueprint?
    • A. 

      User interface designer

    • B. 

      Developer

    • C. 

      Architect

    • D. 

      Technical writer

  • 31. 
    You are planning to develop a new software system for your organization. Someone needs to be responsible for developing system manuals and help files. Which of the following participants should you identify for this task?
    • A. 

      User interface designer

    • B. 

      Content developer

    • C. 

      User interface designer

    • D. 

      Technical writer

  • 32. 
    You are planning to develop a new software system for your organization. You need to verify that the implementation of the system matches with the requirements of the system. Which of the following activities would accomplish this requirement?
    • A. 

      Testing

    • B. 

      Design

    • C. 

      Release

    • D. 

      Requirements analysis

  • 33. 
    You are in the process of developing a new software application. As defects are reported, you take the necessary steps to fix them. You need to make sure that each new fix doesn’t break anything that was previously working. Which type of testing should you use?
    • A. 

      Integration testing

    • B. 

      System testing

    • C. 

      Acceptance testing

    • D. 

      Regression testing

  • 34. 
    You have completed developing a new software application. To ensure the quality of the software, you need to verify that each method or function hasproper test cases available. Which testing approach should you use?
    • A. 

      White-box testing

    • B. 

      Black-box testing

    • C. 

      Alpha testing

    • D. 

      Beta testing

  • 35. 
    You have completed developing several major features of a new software application. You plan to provide an early look at the product to importantcustomers to gather some early feedback. Your application still misses features and you haven’t yet optimized the application for performance andsecurity. Which kind of testing should you perform with a limited number of important customers?
    • A. 

      White-box testing

    • B. 

      Black-box testing

    • C. 

      Alpha testing

    • D. 

      Beta testing

  • 36. 
    You are developing a new application that optimizes the processing of a manufacturing plant’s operations. You need to implement a data structure that works as a “buffer” for overflow capacity. When the manufacturing capacity is available, the items in the buffer need to be processed in the order in which they were added to the buffer. Which data structure should you use to implement such buffer?
    • A. 

      Array

    • B. 

      Linked list

    • C. 

      Stack

    • D. 

      Queue

  • 37. 
    You are developing a new application that optimizes the processing of a warehouse’s operations. When the products arrive, they are stored onwarehouse racks. To minimize the time it takes to retrieve an item, the items that arrive last are the first to go out. You need to represent the items thatarrive and leave the warehouse in a data structure. Which data structure should you use to represent this situation?
    • A. 

      Array

    • B. 

      Linked list

    • C. 

      Stack

    • D. 

      Queue

  • 38. 
    You are developing an application that uses a double dimensional array. You use the following code to declare the array:int[,] numbers = new int[,]{{ 11, 7, 50, 45, 27 },{ 18, 35, 47, 24, 12 },{ 89, 67, 84, 34, 24 },{ 67, 32, 79, 65, 10 }};Next, you refer to an array element by using the expressionnumbers[2, 3]. What will be the return value of this expression?
    • A. 

      47

    • B. 

      84

    • C. 

      24

    • D. 

      34

  • 39. 
    In your application, you are using a queue data structure to manipulate information. You need to find whether a data item exists in the queue, but youdon’t want to actually process that data item yet. Which of the following queue operations will you use?
    • A. 

      Enqueue

    • B. 

      Dequeue

    • C. 

      Peek

    • D. 

      Contains

  • 40. 
    In your application, you are using a stack data structure to manipulate information. You need to find which data item will be processed next, but you don’t want to actually process that data item yet. Which of the following queue operations will you use?
    • A. 

      Pop

    • B. 

      Push

    • C. 

      Peek

    • D. 

      Contains

  • 41. 
    You are developing a sorting algorithm that uses partitioning and comparison to arrange an array of numbers in the correct order. You write a methodthat partitions the array so that the items less thanpivotgo to the left side, whereas the items greater thanpivotgo to the right side. The partitioningmethod has the following signature:static int Partition (int[] numbers, int left,int right, int pivotIndex)Which of the following algorithms should you use to sort the array using thePartitionmethod?
    • A. 

      Static int[] QuickSort(int[] numbers, int left, int right) { if (right > left) { int pivotIndex = left + (right - left) / 2; pivotIndex = Partition( numbers, left, right, pivotIndex); QuickSort( numbers, left, pivotIndex - 1); QuickSort( numbers, pivotIndex + 1, right); } return numbers; }

    • B. 

      Static int[] QuickSort(int[] numbers, int left, int right) { if (right > left) { int pivotIndex = left + (right - left) / 2; pivotIndex = Partition( numbers, left, right, pivotIndex); QuickSort( numbers, left, pivotIndex); QuickSort( numbers, pivotIndex + 1, right); } return numbers; }

    • C. 

      Static int[] QuickSort(int[] numbers, int left, int right) { if (right > left) { int pivotIndex = left + (right - left) / 2; pivotIndex = Partition( numbers, left, right, pivotIndex); QuickSort( numbers, left, pivotIndex - 1); QuickSort( numbers, pivotIndex, right); } return numbers; }

    • D. 

      Static int[] QuickSort(int[] numbers, int left, int right) { if (right > left) { int pivotIndex = left + (right - left) / 2; pivotIndex = Partition( numbers, left, right, pivotIndex); QuickSort( numbers, left, pivotIndex + 1); QuickSort( numbers, pivotIndex + 1, right); } return numbers; }

  • 42. 
    You are developing a C# program that makes use of a singly linked list. You need to traverse all nodes of the list. Which of the following items will youneed to accomplish this requirement?
    • A. 

      Link to the head node

    • B. 

      Link to the tail node

    • C. 

      Data in the head node

    • D. 

      Data in the tail node

  • 43. 
    Which of the following is not true about linked lists?
    • A. 

      A linked list does not allow random access to its items.

    • B. 

      A link to the head node can help you locate all the nodes in a linked list.

    • C. 

      The items in a linked list must be stored in contiguous memory locations.

    • D. 

      Linked lists are extremely fast in performing insert and delete operations.

  • 44. 
    You are developing a program that performs frequent insert and delete operations on the data. Your requirement also dictates the capability to accessprevious and next records when the user clicks the previous or next button. Which of the following data structures will best suit your requirements?
    • A. 

      Array

    • B. 

      Circular linked list

    • C. 

      Linked list

    • D. 

      Doubly linked list

  • 45. 
    You are developing a Web page for a medium-sized business. You want to separate the formatting and layout of the page from its content. Which of the following technologies should you use to define the formatting and layout of the page content?
    • A. 

      Cascading Style Sheet (CSS)

    • B. 

      Hypertext Markup Language (HTML)

    • C. 

      JavaScript

    • D. 

      Hypertext Transmission Protocol (HTTP)

  • 46. 
    You want to display an image on your Web page. This image is stored on a separate Web server but can be accessed with a public URL. Which of thefollowing HTML tags should you use to ensure that the image is displayed when the user navigates to your Web page?
    • A. 

      < LINK >

    • B. 

      < IMG >

    • C. 

      < A >

    • D. 

      < HTML>

  • 47. 
    You are developing a C# program. You write the following code:int x = 10int y = ++xint x = y++;What will be the variable zafter all the above statements are executed?
    • A. 

      10

    • B. 

      11

    • C. 

      12

    • D. 

      13