Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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

Students also viewed these Databases questions

Question

9. Describe the characteristics of power.

Answered: 1 week ago

Question

3. Identify and describe nine cultural value orientations.

Answered: 1 week ago