ログイン

Event-Driven Programming Mocktest (Midterm) BSIT - 505
61問 • 4ヶ月前
  • Xai Alexandrei Delos Reyes
  • 通報

    問題一覧

  • 1

    The exception _______ is called when the execution stack is exhausted by having too many pending method calls.

    System.StackOverflowException

  • 2

    class Program { static void Main() { Thread.CurrentThread.Name = "Primary Thread"; Console.WriteLine("Running on: " + Thread.CurrentThread.Name); Thread worker = new Thread(new ThreadStart(DoWork)); worker.Name = "Worker Thread"; worker.Start(); } static void DoWork() { Console.WriteLine("Running on: " + Thread.CurrentThread.Name); } } What will be the output of this program?

    Running on: Primary Thread Running on: Worker Thread

  • 3

    A thread has finished its task.

    Stopped

  • 4

    It is used to get or set the name of the thread

    Name

  • 5

    It interrupts the thread that is in the state of WaitSleepJoin

    public void Interrupt()

  • 6

    is represented by classes. All the exceptions are subclasses in this built-in exception class, wherein it is a part of namespace System.

    Exception

  • 7

    These exceptions are user program-generated.

    ApplicationException

  • 8

    These exceptions are generated by Common Language Runtime (CLR).

    SystemException

  • 9

    This is at the top of the standards’ exceptions hierarchy. The runtime system in C# generates all the exceptions.

    System.Exception

  • 10

    Errors in arithmetic or conversion operation will be thrown in this exception.

    System.ArithmeticException

  • 11

    When an overflow occurs in a checked operation, it will be thrown in _______.

    System.OverflowException

  • 12

    Any invalid argument in a method will be thrown in this exception.

    System.ArgumentException

  • 13

    If there is an unacceptable argument passed to a method, it will be thrown in _______.

    System.ArgumentNullException

  • 14

    Throw in this exception when attempting to index an array through an index that is either less than zero or greater than the maximum length of index.

    System.IndexOutOfRangeException

  • 15

    If the available memory becomes too low to accommodate a memory allocation request, it will be thrown in ________.

    System.OutOfMemoryException

  • 16

    The exception _______ is called when the execution stack is exhausted by having too many pending method calls.

    System.StackOverflowException

  • 17

    This exception checks the format of the string or argument if it is invalid.

    System.FormatException

  • 18

    This keyword is used to check for the occurrence of any exceptions enclosed to it.

    try

  • 19

    This keyword catches the exception that is thrown on the occurrence of exception in a try block.

    catch

  • 20

    It is used to throw an exception manually.

    throw

  • 21

    This keyword executes a given statement even if the exception is thrown or not thrown. This block cannot transfer control by using break, continue, return, or goto.

    finally

  • 22

    Manually throwing using the throw keyword can also be used. The syntax is?

    throw new exception_Object;

  • 23

    The ______ is an instance of a class derived from the Exception class.

    exception_Object

  • 24

    In creating an instance of Exception_object, what keyword is used?

    new

  • 25

    try{ int num1, num2; num1 = 0; num2 = 55 / y; Console.Write("Answer: " + x); } catch(ArithmeticException ex) { Console.Write(" B "); } finally { Console.Write(" C "); } Which of the following outputs is correct based on the given code?

    B C

  • 26

    What will be the output of the code below? try{ Console.WriteLine("Exception:" + " " + 25 / Convert.ToInt32()); } catch(ArithmeticException ex) { Console.WriteLine("Divide By Zero Error"); }

    Divide By Zero Error

  • 27

    What keyword is used to re-throw an exception?

    throw

  • 28

    Which of the following outputs is correct based on the given code? try { int[] arr = {1, 2, 3, 4, 5}; for(int i = 0; i < 5; i++){ Console.WriteLine(arr[i]); } } catch(IndexOutOfRangeException ie) { Console.WriteLine("Index Out Of Range Exception"); } catch(ArithmeticException ae){ Console.WriteLine("Arithmetic Exception"); } Console.ReadLine();

    1 2 3 4 5

  • 29

    Which of the following outputs of the code will show? try { int[] numArr = {15, 22, 143, 54, 85}; for(int i = 0; i < 6; i++){ Console.Write(numArr[i] + ", "); } } catch(IndexOutOfRangeException ex){ Console.Write("Index Out Of Range!"); } Console.ReadLine();

    15, 22, 143, 54, 85, Index Out Of Range!

  • 30

    What is the syntax of creating a custom exception?

    public class CustomizeException: Exception{ }

  • 31

    This is a class in C#.net that can be found in the System.Threading namespace. It is used to create and control threads in a system or application, in which the properties and methods are already provided.

    Thread

  • 32

    Which statement is NOT TRUE for Thread?

    These are always generated by Common Language Runtime (CLR).

  • 33

    When using the Thread class, the first thread to be performed in a process is known as the _______?

    Main Thread

  • 34

    The other threads that are made using the Thread class are known as the _____ of the main thread.

    Child Thread

  • 35

    Which is the correct syntax for creating a Main thread?

    Thread basicThread = Thread.CurrentThread; basicThread.Name = "Basic C# Thread"; Console.WriteLine("Current Thread: {0}", basicThread.Name);

  • 36

    Creating a child thread for the main thread should write or create a delegate object, passing a callback method to it as a parameter.

    True

  • 37

    In Child Thread, When the thread object is created, the delegate will be used to initialize the thread object.

    True

  • 38

    In Child Thread, To define a callback method in the delegate, use ThreadStart to execute the code when the thread started.

    True

  • 39

    In Child Thread, A ThreadStart delegate represents a method that runs in the Thread class.

    True

  • 40

    class Program { static void Main() { Thread.CurrentThread.Name = "Primary Thread"; Console.WriteLine("Running on: " + Thread.CurrentThread.Name); Thread worker = new Thread(new ThreadStart(DoWork)); worker.Name = "Worker Thread"; worker.Start(); } static void DoWork() { Console.WriteLine("Running on: " + Thread.CurrentThread.Name); } } What will be the output of this program?

    Running on: Primary Thread Running on: Worker Thread

  • 41

    A thread is created within the Common Language Runtime (CLR) but has not started.

    Unstarted

  • 42

    A thread is ready to run and is waiting for the CPU time.

    Ready

  • 43

    A thread is in this mode after invoking its Start method

    Running

  • 44

    A running thread is suspended temporarily by invoking either this method or the monitor’s Wait method.

    WaitSleepJoin

  • 45

    A suspended thread resumes to this state when the conditions for which is it was suspended are no longer valid.

    Started

  • 46

    A thread is blocked when it is waiting for a resource or I/O operations.

    Blocked

  • 47

    A thread has finished its task.

    Stopped

  • 48

    It returns the current thread that is running.

    CurrentThread

  • 49

    It returns a Boolean value indicating the execution status of the recent thread.

    IsAlive

  • 50

    It is used to get or set a value that indicates whether the thread is a background thread or not.

    IsBackground

  • 51

    It is used to get or set the name of the thread

    Name

  • 52

    It is used to get or set a value that represents the priority of a thread.

    Priority

  • 53

    It is used to get the value that contains the states of the recent thread

    ThreadState

  • 54

    It terminates the thread when calling this method and raises ThreadAbortException in the thread

    public void Abort()

  • 55

    It interrupts the thread that is in the state of WaitSleepJoin

    public void Interrupt()

  • 56

    It is used to stop the calling thread until a thread terminates.

    public void Join()

  • 57

    It is used to withdraw an abort request for the ongoing thread.

    public static void ResetAbort()

  • 58

    It is used to start a thread.

    public void Start()

  • 59

    It is used to pause a thread for the stated number in milliseconds

    public static void Sleep()

  • 60

    When The two (2) child threads are gotten from the same resource simultaneously for manipulation, which is known as ______

    Race condition

  • 61

    It is a common feature that allows your application to have more than (1) execution path at the same time.

    Multithreading

  • The Contemporary World Mock test (Prelims)

    The Contemporary World Mock test (Prelims)

    Xai Alexandrei Delos Reyes · 58問 · 2年前

    The Contemporary World Mock test (Prelims)

    The Contemporary World Mock test (Prelims)

    58問 • 2年前
    Xai Alexandrei Delos Reyes

    Computing Mock test (Prelims)

    Computing Mock test (Prelims)

    Xai Alexandrei Delos Reyes · 67問 · 2年前

    Computing Mock test (Prelims)

    Computing Mock test (Prelims)

    67問 • 2年前
    Xai Alexandrei Delos Reyes

    Programming Mock Test (Prelims)

    Programming Mock Test (Prelims)

    Xai Alexandrei Delos Reyes · 64問 · 2年前

    Programming Mock Test (Prelims)

    Programming Mock Test (Prelims)

    64問 • 2年前
    Xai Alexandrei Delos Reyes

    Entrepreneurship Mock Test (Prelims)

    Entrepreneurship Mock Test (Prelims)

    Xai Alexandrei Delos Reyes · 23問 · 2年前

    Entrepreneurship Mock Test (Prelims)

    Entrepreneurship Mock Test (Prelims)

    23問 • 2年前
    Xai Alexandrei Delos Reyes

    Computing Mock Test (Midterms) BSIT 107

    Computing Mock Test (Midterms) BSIT 107

    Xai Alexandrei Delos Reyes · 76問 · 2年前

    Computing Mock Test (Midterms) BSIT 107

    Computing Mock Test (Midterms) BSIT 107

    76問 • 2年前
    Xai Alexandrei Delos Reyes

    Math Mock Test (Prelims)

    Math Mock Test (Prelims)

    Xai Alexandrei Delos Reyes · 48問 · 2年前

    Math Mock Test (Prelims)

    Math Mock Test (Prelims)

    48問 • 2年前
    Xai Alexandrei Delos Reyes

    Programming Mock Test (Midterms) BSIT 107

    Programming Mock Test (Midterms) BSIT 107

    Xai Alexandrei Delos Reyes · 52問 · 2年前

    Programming Mock Test (Midterms) BSIT 107

    Programming Mock Test (Midterms) BSIT 107

    52問 • 2年前
    Xai Alexandrei Delos Reyes

    UTS Mock Test (Midterms) BSIT107

    UTS Mock Test (Midterms) BSIT107

    Xai Alexandrei Delos Reyes · 40問 · 2年前

    UTS Mock Test (Midterms) BSIT107

    UTS Mock Test (Midterms) BSIT107

    40問 • 2年前
    Xai Alexandrei Delos Reyes

    Entrepreneurship Mock Test (Midterms) BSIT 107

    Entrepreneurship Mock Test (Midterms) BSIT 107

    Xai Alexandrei Delos Reyes · 38問 · 2年前

    Entrepreneurship Mock Test (Midterms) BSIT 107

    Entrepreneurship Mock Test (Midterms) BSIT 107

    38問 • 2年前
    Xai Alexandrei Delos Reyes

    Contemporary World Mock Test (Midterms) BSIT 107

    Contemporary World Mock Test (Midterms) BSIT 107

    Xai Alexandrei Delos Reyes · 28問 · 2年前

    Contemporary World Mock Test (Midterms) BSIT 107

    Contemporary World Mock Test (Midterms) BSIT 107

    28問 • 2年前
    Xai Alexandrei Delos Reyes

    Math Mocktest (Midterms) BSIT 107

    Math Mocktest (Midterms) BSIT 107

    Xai Alexandrei Delos Reyes · 24問 · 2年前

    Math Mocktest (Midterms) BSIT 107

    Math Mocktest (Midterms) BSIT 107

    24問 • 2年前
    Xai Alexandrei Delos Reyes

    Computer Programming Mocktest (Pre-finals)

    Computer Programming Mocktest (Pre-finals)

    Xai Alexandrei Delos Reyes · 26問 · 2年前

    Computer Programming Mocktest (Pre-finals)

    Computer Programming Mocktest (Pre-finals)

    26問 • 2年前
    Xai Alexandrei Delos Reyes

    Math Mocktest (Pre-Finals)

    Math Mocktest (Pre-Finals)

    Xai Alexandrei Delos Reyes · 19問 · 2年前

    Math Mocktest (Pre-Finals)

    Math Mocktest (Pre-Finals)

    19問 • 2年前
    Xai Alexandrei Delos Reyes

    Computing Mock Test (Pre-finals)

    Computing Mock Test (Pre-finals)

    Xai Alexandrei Delos Reyes · 36問 · 2年前

    Computing Mock Test (Pre-finals)

    Computing Mock Test (Pre-finals)

    36問 • 2年前
    Xai Alexandrei Delos Reyes

    Computing Mock Test Finals

    Computing Mock Test Finals

    Xai Alexandrei Delos Reyes · 26問 · 2年前

    Computing Mock Test Finals

    Computing Mock Test Finals

    26問 • 2年前
    Xai Alexandrei Delos Reyes

    Comprog 2nd sem (prelims) BSIT 205

    Comprog 2nd sem (prelims) BSIT 205

    Xai Alexandrei Delos Reyes · 63問 · 1年前

    Comprog 2nd sem (prelims) BSIT 205

    Comprog 2nd sem (prelims) BSIT 205

    63問 • 1年前
    Xai Alexandrei Delos Reyes

    Discrete Math 2nd sem (prelims) BSIT 205

    Discrete Math 2nd sem (prelims) BSIT 205

    Xai Alexandrei Delos Reyes · 36問 · 1年前

    Discrete Math 2nd sem (prelims) BSIT 205

    Discrete Math 2nd sem (prelims) BSIT 205

    36問 • 1年前
    Xai Alexandrei Delos Reyes

    Art Appreciation (Prelim) BSIT 205

    Art Appreciation (Prelim) BSIT 205

    Xai Alexandrei Delos Reyes · 56問 · 1年前

    Art Appreciation (Prelim) BSIT 205

    Art Appreciation (Prelim) BSIT 205

    56問 • 1年前
    Xai Alexandrei Delos Reyes

    Ethics 2nd sem (Prelims) BSIT 205

    Ethics 2nd sem (Prelims) BSIT 205

    Xai Alexandrei Delos Reyes · 45問 · 1年前

    Ethics 2nd sem (Prelims) BSIT 205

    Ethics 2nd sem (Prelims) BSIT 205

    45問 • 1年前
    Xai Alexandrei Delos Reyes

    STS 2nd Sem (Prelim) BSIT 205

    STS 2nd Sem (Prelim) BSIT 205

    Xai Alexandrei Delos Reyes · 40問 · 1年前

    STS 2nd Sem (Prelim) BSIT 205

    STS 2nd Sem (Prelim) BSIT 205

    40問 • 1年前
    Xai Alexandrei Delos Reyes

    問題一覧

  • 1

    The exception _______ is called when the execution stack is exhausted by having too many pending method calls.

    System.StackOverflowException

  • 2

    class Program { static void Main() { Thread.CurrentThread.Name = "Primary Thread"; Console.WriteLine("Running on: " + Thread.CurrentThread.Name); Thread worker = new Thread(new ThreadStart(DoWork)); worker.Name = "Worker Thread"; worker.Start(); } static void DoWork() { Console.WriteLine("Running on: " + Thread.CurrentThread.Name); } } What will be the output of this program?

    Running on: Primary Thread Running on: Worker Thread

  • 3

    A thread has finished its task.

    Stopped

  • 4

    It is used to get or set the name of the thread

    Name

  • 5

    It interrupts the thread that is in the state of WaitSleepJoin

    public void Interrupt()

  • 6

    is represented by classes. All the exceptions are subclasses in this built-in exception class, wherein it is a part of namespace System.

    Exception

  • 7

    These exceptions are user program-generated.

    ApplicationException

  • 8

    These exceptions are generated by Common Language Runtime (CLR).

    SystemException

  • 9

    This is at the top of the standards’ exceptions hierarchy. The runtime system in C# generates all the exceptions.

    System.Exception

  • 10

    Errors in arithmetic or conversion operation will be thrown in this exception.

    System.ArithmeticException

  • 11

    When an overflow occurs in a checked operation, it will be thrown in _______.

    System.OverflowException

  • 12

    Any invalid argument in a method will be thrown in this exception.

    System.ArgumentException

  • 13

    If there is an unacceptable argument passed to a method, it will be thrown in _______.

    System.ArgumentNullException

  • 14

    Throw in this exception when attempting to index an array through an index that is either less than zero or greater than the maximum length of index.

    System.IndexOutOfRangeException

  • 15

    If the available memory becomes too low to accommodate a memory allocation request, it will be thrown in ________.

    System.OutOfMemoryException

  • 16

    The exception _______ is called when the execution stack is exhausted by having too many pending method calls.

    System.StackOverflowException

  • 17

    This exception checks the format of the string or argument if it is invalid.

    System.FormatException

  • 18

    This keyword is used to check for the occurrence of any exceptions enclosed to it.

    try

  • 19

    This keyword catches the exception that is thrown on the occurrence of exception in a try block.

    catch

  • 20

    It is used to throw an exception manually.

    throw

  • 21

    This keyword executes a given statement even if the exception is thrown or not thrown. This block cannot transfer control by using break, continue, return, or goto.

    finally

  • 22

    Manually throwing using the throw keyword can also be used. The syntax is?

    throw new exception_Object;

  • 23

    The ______ is an instance of a class derived from the Exception class.

    exception_Object

  • 24

    In creating an instance of Exception_object, what keyword is used?

    new

  • 25

    try{ int num1, num2; num1 = 0; num2 = 55 / y; Console.Write("Answer: " + x); } catch(ArithmeticException ex) { Console.Write(" B "); } finally { Console.Write(" C "); } Which of the following outputs is correct based on the given code?

    B C

  • 26

    What will be the output of the code below? try{ Console.WriteLine("Exception:" + " " + 25 / Convert.ToInt32()); } catch(ArithmeticException ex) { Console.WriteLine("Divide By Zero Error"); }

    Divide By Zero Error

  • 27

    What keyword is used to re-throw an exception?

    throw

  • 28

    Which of the following outputs is correct based on the given code? try { int[] arr = {1, 2, 3, 4, 5}; for(int i = 0; i < 5; i++){ Console.WriteLine(arr[i]); } } catch(IndexOutOfRangeException ie) { Console.WriteLine("Index Out Of Range Exception"); } catch(ArithmeticException ae){ Console.WriteLine("Arithmetic Exception"); } Console.ReadLine();

    1 2 3 4 5

  • 29

    Which of the following outputs of the code will show? try { int[] numArr = {15, 22, 143, 54, 85}; for(int i = 0; i < 6; i++){ Console.Write(numArr[i] + ", "); } } catch(IndexOutOfRangeException ex){ Console.Write("Index Out Of Range!"); } Console.ReadLine();

    15, 22, 143, 54, 85, Index Out Of Range!

  • 30

    What is the syntax of creating a custom exception?

    public class CustomizeException: Exception{ }

  • 31

    This is a class in C#.net that can be found in the System.Threading namespace. It is used to create and control threads in a system or application, in which the properties and methods are already provided.

    Thread

  • 32

    Which statement is NOT TRUE for Thread?

    These are always generated by Common Language Runtime (CLR).

  • 33

    When using the Thread class, the first thread to be performed in a process is known as the _______?

    Main Thread

  • 34

    The other threads that are made using the Thread class are known as the _____ of the main thread.

    Child Thread

  • 35

    Which is the correct syntax for creating a Main thread?

    Thread basicThread = Thread.CurrentThread; basicThread.Name = "Basic C# Thread"; Console.WriteLine("Current Thread: {0}", basicThread.Name);

  • 36

    Creating a child thread for the main thread should write or create a delegate object, passing a callback method to it as a parameter.

    True

  • 37

    In Child Thread, When the thread object is created, the delegate will be used to initialize the thread object.

    True

  • 38

    In Child Thread, To define a callback method in the delegate, use ThreadStart to execute the code when the thread started.

    True

  • 39

    In Child Thread, A ThreadStart delegate represents a method that runs in the Thread class.

    True

  • 40

    class Program { static void Main() { Thread.CurrentThread.Name = "Primary Thread"; Console.WriteLine("Running on: " + Thread.CurrentThread.Name); Thread worker = new Thread(new ThreadStart(DoWork)); worker.Name = "Worker Thread"; worker.Start(); } static void DoWork() { Console.WriteLine("Running on: " + Thread.CurrentThread.Name); } } What will be the output of this program?

    Running on: Primary Thread Running on: Worker Thread

  • 41

    A thread is created within the Common Language Runtime (CLR) but has not started.

    Unstarted

  • 42

    A thread is ready to run and is waiting for the CPU time.

    Ready

  • 43

    A thread is in this mode after invoking its Start method

    Running

  • 44

    A running thread is suspended temporarily by invoking either this method or the monitor’s Wait method.

    WaitSleepJoin

  • 45

    A suspended thread resumes to this state when the conditions for which is it was suspended are no longer valid.

    Started

  • 46

    A thread is blocked when it is waiting for a resource or I/O operations.

    Blocked

  • 47

    A thread has finished its task.

    Stopped

  • 48

    It returns the current thread that is running.

    CurrentThread

  • 49

    It returns a Boolean value indicating the execution status of the recent thread.

    IsAlive

  • 50

    It is used to get or set a value that indicates whether the thread is a background thread or not.

    IsBackground

  • 51

    It is used to get or set the name of the thread

    Name

  • 52

    It is used to get or set a value that represents the priority of a thread.

    Priority

  • 53

    It is used to get the value that contains the states of the recent thread

    ThreadState

  • 54

    It terminates the thread when calling this method and raises ThreadAbortException in the thread

    public void Abort()

  • 55

    It interrupts the thread that is in the state of WaitSleepJoin

    public void Interrupt()

  • 56

    It is used to stop the calling thread until a thread terminates.

    public void Join()

  • 57

    It is used to withdraw an abort request for the ongoing thread.

    public static void ResetAbort()

  • 58

    It is used to start a thread.

    public void Start()

  • 59

    It is used to pause a thread for the stated number in milliseconds

    public static void Sleep()

  • 60

    When The two (2) child threads are gotten from the same resource simultaneously for manipulation, which is known as ______

    Race condition

  • 61

    It is a common feature that allows your application to have more than (1) execution path at the same time.

    Multithreading