申論 4程式例外處理的設計對於資訊系統的可靠性非常重要。㈠請完成以下C++程式(I)~(V)指令,處理兩數相除的例外狀況,使輸出為:(15 分)Exception:emptyException:not a numberQuotient:Exception:divided by zeroQuotient:2.4#include <iostream>#include <exception>#include <string.h>#define N 10using namespace std;class EmptyException:public exception {public:virtual const char* what()const throw(){(I);}};class NotNumberException:public exception {public:virtual const char* what()const throw(){(II);}};class DividedByZeroException:public exception {public:virtual const char* what()const throw(){(III);}};int valid(const char x[N]){int result=0;if(strlen(x)==0)throw EmptyException();for(int i=0; i<strlen(x); i++){if(!isdigit(x[i]))throw NotNumberException();result =(IV);}return result;}double quotient(int n1, int n2){if((V))throw DividedByZeroException();return static_cast<double>(n1/n2);}void test(const char x1[N], const char x2[N]){int n1, n2;try {n1=valid(x1);n2=valid(x2);cout<<"Quotient:"<<quotient(n1, n2);}catch(EmptyException &e){cout<<"Exception:"<< e.what();}catch(NotNumberException &e){cout<<"Exception:"<< e.what();}catch(DividedByZeroException &e){cout<<"Exception:"<< e.what();}cout<<endl;}int main(){test("","");test("a","12");test("10","0");test("12","5");return 0;}㈡請說明使用try-catch 與if-else,處理例外狀況的優缺點。(5 分)㈢請說明C++與Java 在try-catch 中finally 設計的異同與其理由。(5 分)