Searching for "execution."

Q:

In computer processing, __________ selects processes from the pool and loads them into memory for execution.

A) Job Scheduler B) Resource Scheduler
C) CPU Scheduler D) Process Scheduler
 
Answer & Explanation Answer: A) Job Scheduler

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Computer

Q:

You develop a Windows-based application that enables to enter product sales. You add a subroutine named XYZ.

 

You discover that XYZ sometimes raises an IOException during execution. To address this problem you create two additional subroutines named LogError and CleanUp. These subroutines are governed by the following rules:

• LogError must be called only when XYZ raises an exception.
• CleanUp must be called whenever XYZ is complete.

 

 You must ensure that your application adheres to these rules. Which code segment should you use?

A) try { XYZ(); LogError(); } catch (Exception e) { CleanUp(e); } B) try { XYZ(); } catch (Exception e) { LogError(e); CleanUp(); }
C) try { XYZ(); } catch (Exception e) { LogError(e); } finally { CleanUp(); } D) try { XYZ(); } catch (Exception e) { CleanUp(e); } finally { LogError(); }
 
Answer & Explanation Answer: C) try { XYZ(); } catch (Exception e) { LogError(e); } finally { CleanUp(); }

Explanation:

We must use a try…catch…finally construct. First we run the Comapany() code in the try block.Then we use the LogError() subroutine in the catch statement since all exceptions are handled here. Lastly we put the CleanUp() subroutine in the finally statement since this code will be executed regardless of whether an exception is thrown or not.

Report Error

View Answer Report Error Discuss