How would i rewrite the function header for

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ers a correct value, getGallons prints either the user entered value or the default value. An appropriate printed message might be “returning 15.7 gallons”. Make sure that this message gets printed, even if the specification is later changed so that the InputMismatchException gets rethrown. 4. Returns the number of gallons (either the user- provided value or the default value). b. Suppose that instead of catching and handling the InputMismatchException, that I want to have the calling function handle it. Although I’m not required to, I would like my function to be a good citizen and declare to the compiler that it is not going to handle the InputMismatchException. How would I rewrite the function header for getGallons? 4. (16 points) Write a Java template class named Label...
View Full Document

This document was uploaded on 03/23/2014 for the course CS 365 at University of Tennessee.

Ask a homework question - tutors are online