Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In cityFinals() you should call exceptionGenerator.runCourse(). If no exception is thrown, print out No exception thrown. If the call to runCourse() resulted in a checked

In cityFinals() you should call exceptionGenerator.runCourse(). If no exception is thrown, print out "No exception thrown". If the call to runCourse() resulted in a checked exception, print out "Caught checked exception". If runCourse() resulted in an unchecked exception, print out "Caught unchecked exception".

In mountMidoriyama() you will handle the results of the grand finale. If the throwChecked parameter is true, your code should raise a RopeClimbException. If the throwUnchecked parameter is true instead, your code should raise a TimeException. If both parameters are false, nothing else needs to be done.

Use @param mentioned in comments. Code must only be written in each of the methods. No additional methods necessary.

public class AmericanExceptionWarrior { /** * Method which attempts to complete the city finals by conquering the Qualifying Course. QualifyingCourse has a * single method: {@code runCourse()}. When this method is called, it could throw a checked exception * ({@code RopeClimbException}), throw an unchecked exception ({@code TimeException}), or not throw any exception. If * an exception is thrown, the method should catch the exception and print "Caught checked exception" or "Caught * unchecked exception" (as appropriate). If no exception is thrown, the method should print "No exception thrown" * * @param exceptionGenerator Class whose method, runCourse(), will be used to help test this Exception Warrior. */ public void cityFinals(QualifyingCourse exceptionGenerator) { } /** * Method to conquer the course at the grand finale -- throwing exceptions on your own. This has two parameters: * throwChecked and throwUnchecked. If throwChecked is true, the method should raise a {@code RopeClimbException}. * When throwUnchecked is true, the method should raise a {@code TimeException}. When both parameters are false, the * method should not raise any exceptions. * * @param throwChecked When true, the method should raise a {@RopeClimbException}. * @param throwUnchecked When true, the method should raise a {@TimeException}. */ public void mountMidoriyama(boolean throwChecked, boolean throwUnchecked) throws RopeClimbException { } } 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago