For each function, f(), g() and h() state how what exceptions should be thrown.

Given these three functions with different exception specifications
What will be an ideal response?
a) void f()throw();
b) void g()throw(int, string);
c) void h();

The function f() should throw no exceptions at all unless the exception is
caught inside of f(). The function g() should throw only int and string type
exceptions. The function h() may throw an exception of any type.
Explanation: Part a) has an empty exception list, prohibiting any exceptions. Part b)
specifies only int and string. Part c) prohibits nothing.

Computer Science & Information Technology

You might also like to view...

Companies that are planning to make a long-term investment, like the purchase of machinery, typically use ________ to evaluate whether the endeavor is worth pursuing

A) capital budgeting B) amortization table C) cash flows D) present value analysis

Computer Science & Information Technology

The ________ function determines the value of an investment or business by analyzing an irregular time series of incoming and outgoing cash flows

A) NPV B) XNPV C) IRR D) XIRR

Computer Science & Information Technology