Title Throw IllegalArgumentException in Vehicle constructor
Catalog Type SLCItem
Persistent ID https://codecheck.io/files/horstmann/codecheck-bj-4-io-109
Platform Name CodeCheck
Features Code Completion
Description The Vehicle class given below is used to represent various types of self-propelled vehicles. It should be illegal to construct a Vehicle of type "truck" with less than 4 wheels, or a Vehicle of type "motorcycle" with any number of wheels except 2. Modify the constructor so that an IllegalArgumentException is thrown if either of these conditions are not met.
Keywords Input and Output
Author Cay Horstmann
Institution San José State University
Iframe URL https://codecheck.io/files/horstmann/codecheck-bj-4-io-109
Protocol SPLICE, LTI 1.1
Protocol URL
License https://creativecommons.org/licenses/by-nc-nd/4.0/
Programming Language Java
Natural Language en

Preview

SPLICE Output