Car Exercise

Car class:

  • regNo: String

  • make: String

  • doors: int

  • color: CarColor (Black, White, Blue)

    Deny if regNo doens't have 7 chars Deny if make is null or empty Deny if number of doors is not between 2 and 5 (2 ≤ doors ≤ 5)

Onwer class:

  • name: String

  • address: String

  • phone: String

    Deny if name is smaller than 4 chars Deny if address is smaller than 6 chars Deny if phone doesn't have exaclty 8 digits

Check out the source code on GitHub.