- InsertUniqueVolumeBoxes.java Topic: Collection Framework: Set interface, Hashset. Insert the box details into the set. Create a box class and its attributes are length breadth and height (Double Type). Get the box details from the user and insert into the set. We need to store the details of the boxes with different volumes when the volume of the box is the same as the volume of previous boxes included don't add this box in the set. The boxes are called same when their volumes are equal.
- UserRegistration.java
Topic: Exception Handling: Create custom exceptions. A student portal provides user to register their profile, during registration the system needs to validate the user should be located in India. If not the system should throw an exception.
step 1: Create a user defined exception class InvalidCountryException
step 2: Create a main class UserRegistration and following method registerUser() the parameters are String userName and String userCountry
step 3: Logic inside the methods
(i) If userCountry is not India throw a InvalidCountryException with the
Message "User outside India cannot be registered".
(ii) If userCountry is India print the message "User Registration successful"
Link: https://github.com/ishubhamparmar/MiniProjectJava/blob/main/UserRegistration.java
I'm a pre-final year Computer Science Engineering undergrad @ RGPV Bhopal. Currently Polishing DSA, Problem Solving and Web Development Skills.
Java, Javascript, HTML, CSS...