Question: Only Java code please. Info: Customer is a class and creditrating is an enumerator with values iron,bronze,silver,gold. In the code, it seems to be possible

 Only Java code please. Info: Customer is a class and creditrating

Only Java code please. Info: Customer is a class and creditrating is an enumerator with values iron,bronze,silver,gold.

In the code, it seems to be possible to set a dateOfDeath before the dateOfBirth. We will indeed allow that, but do return an error. Define the class ZombieException for this. Two methods are going to throw this new exception: setDateOfBirth and setdateOfDeath. If the dateOfDeath is before the dateOfBirth, change it anyway and throw a new ZombieException. A customer can have its credit rating decrease to IRON. If that happens, but the customer did not have any orders yet, something weird is happening. Change the rating to IRON anyway, and throw a new ZombieException with as the parameter to the constructor a new IllegalStateException. This is called exception chaining; check it if you need to

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!