Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Class Loan - define the object of HashMap > with variable name app listThe String defines the name of the person and the Arraylist will
Class Loandefine the object of HashMap with variable name app listThe String defines the name of the person and the Arraylist will have list of applicationsImplement the below methods for this class:String registerApplicationString name. Application ap:Write a code to add a new application in the list with the name as key after the following validations:If there is no key with the given name then add a new key and add the application into this list and return "New user".If the name is already present check if the number of applications is not greater than If it is greater than return "Application list full".If the list doesn't have applications, then add the new application to the list and return "New application registered"String cancelApplicationString name. Application ap:Write a code to check if the given person exists or not.If the person is not present then return No user found".If the user exists then check if the application is present or not.If the application is not present then return No application found".If the application is present and it is the only application present then remove the name of the person also and return Cancelled successfully".
Step 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