Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 toStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started