Q5.cpp - #include <iostream>#include <stdexcept>\/using runtime_error using namespace std class Exception public runtime_error public Exception

Q5.cpp - #include <iostream>#include <stdexcept>/using...

This preview shows page 1 out of 1 page.

#include <iostream> #include <stdexcept> //using runtime_error using namespace std; class Exception : public runtime_error { public: Exception() : runtime_error("Math error: Attempted to divide by Zero\n") { } }; float Division(float num, float den) { if (den == 0) throw Exception();
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

  • Fall '18
  • Zia Ul Rehman
  • #include, denom, float num, Float Division

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture