Question: Integer cylinderHeight is read from input. Complete the try block to throw a runtime error exception with the message Your input cannot be processed if

Integer cylinderHeight is read from input. Complete the try block to throw a runtime error exception with the message "Your input cannot be processed" if cylinderHeight is 0.

Ex: If input is 74, then the output is:

Cylinder's height submitted: 74 

Ex: If input is -44, then the output is:

Error: Your input cannot be processed

#include #include using namespace std;

int main() { int cylinderHeight;

cin >> cylinderHeight;

try { if (cylinderHeight <= 0) { throw /* Your code goes here */; } cout << "Cylinder's height submitted: " << cylinderHeight << endl; } catch (runtime_error& excpt) { cout << "Error: " << excpt.what() << endl; }

return 0; }

c++ and please please make it correct

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!