Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Do in Java // Implement user defined exception classes class Applicant { private String name; private String jobProfile; private int age; public String getName() {

Do in Java image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

// Implement user defined exception classes

class Applicant {

private String name; private String jobProfile; private int age;

public String getName() { return name; } public void setName(String name) { this.name = name; } public String getJobProfile() { return jobProfile; } public void setJobProfile(String jobProfile) { this.jobProfile = jobProfile; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } }

class Validator{ public class ValidateName{ public String boolean{ if(name != null){ return name; }else{ exception{ System.out.println("Invalid name"); } } } } public class ValidateJobProfile{ public String ValidateJobProfile boolean{ if(jobProfile = ("associate" || "clerk" || "executive" || "Officer"){ return jobProfile; } else{ exception{ System.out.println("Invalid job post"); } } } } public class Age{ public int age boolean{ if(age(30>=age

public static void main(String[] args) { try { Applicant applicant= new Applicant(); applicant.setName("Jenny"); applicant.setJobProfile("Clerk"); applicant.setAge(25); Validator validator = new Validator(); validator.validate(applicant); System.out.println("Application submitted successfully!"); } catch (InvalidNameException|InvalidJobProfileException|InvalidAgeException e) { System.out.println(e.getMessage()); } } }

A bank wants to conduct examinations for recruitment. You need to develop an application for the applicants to submit their details by implementing the classes based on the class diagram and description given below. Applicant name: String o jobProfile: String ageint getName(): String setName(name: String): void getjob Profile(): String setJobProfileljobProfile String): void getAge: int setAgelage: int)void InvalidAgeException InvalidAgeException(message: String) InvalidJobProfileException TovalidJobProfileException message: String)

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

Recommended Textbook for

Students also viewed these Databases questions

Question

what is a peer Group? Importance?

Answered: 1 week ago