Answered step by step
Verified Expert Solution
Link Copied!

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 Loan-define 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 registerApplication(String 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 5.If it is greater than 5 return "Application list full".If the list doesn't have 5 applications, then add the new application to the list and return "New application registered"-String cancelApplication(String 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

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

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions