java language A system needs to have a Validation class that can validate the input for instance variables of the different classes given in Table 1. It should validate the values for the data members from different classes using Regular Expressions, such that a name can only contain alphabets from A to Z or a to z and the first letter is always a capital letter. The address should start with a number followed by one or two words (for example 16 Khyber or 16 Khyber Ave). The phone number should have a format like 0-000-0000000 where the first digit is always a 0. The e-mail address should contain exactly one ‘@’ character and at least one ‘.’ character. A car’s registration number can only contain a maximum of 3 English alphabets followed by not more than 4 digits. All the classes should be able to validate their data without creating the objects

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter10: Object-oriented Programming
Section: Chapter Questions
Problem 5RQ
icon
Related questions
Question
100%

java language

A system needs to have a Validation class that can validate the input for instance variables of
the different classes given in Table 1. It should validate the values for the data members from different classes
using Regular Expressions, such that a name can only contain alphabets from A to Z or a to z and the first
letter is always a capital letter. The address should start with a number followed by one or two words (for
example 16 Khyber or 16 Khyber Ave). The phone number should have a format like 0-000-0000000 where the first digit is always a 0. The e-mail address should contain exactly one ‘@’ character and at least one ‘.’
character. A car’s registration number can only contain a maximum of 3 English alphabets followed by not
more than 4 digits. All the classes should be able to validate their data without creating the objects

Table 1:
Class
Attributes
name, registration number, engine number, chassis number, city of registrat
make and model, color, the date of the registration, price, the date of arrival of
car to the dealership, type of the vehicle, and whether the car is sold or not.
dealer's name, dealer's id, dealer's address, and the dealer's phone number.
dealer object also keeps track of the cars that the dealer has.
A person has a name, address, phone number and e-mail address.
Car
Dealer
Person
Transcribed Image Text:Table 1: Class Attributes name, registration number, engine number, chassis number, city of registrat make and model, color, the date of the registration, price, the date of arrival of car to the dealership, type of the vehicle, and whether the car is sold or not. dealer's name, dealer's id, dealer's address, and the dealer's phone number. dealer object also keeps track of the cars that the dealer has. A person has a name, address, phone number and e-mail address. Car Dealer Person
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage