Question 1: Online Shopping Cart Management System

ShopEasy e-commerce platform wants to implement a smart shopping cart system that can handle multiple customers and provide personalized recommendations. Create a Java application to manage shopping carts and analyze purchase patterns.

Component Specification: Product

class Product {
    private String productId;
    private String productName;
    private String category;
    private double price;
    *// Constructor, getters, setters, equals, hashCode*
}

Component Specification: ShoppingCart

class ShoppingCart {
    private String customerId;
    private Map<Product, Integer> cartItems; *// Product and quantity*
    private Set<String> appliedCoupons;
    *// Constructor, methods to add/remove items*
}

Requirements:

Sample Input/Output:

Enter number of cart entries 4 Enter cart details C001:P101:Laptop:Electronics:75000.00:1:SAVE10,STUDENT C002:P102:Shirt:Clothing:1500.00:3:FREESHIP C001:P103:Mouse:Electronics:800.00:2:SAVE10 C003:P104:Book:Education:500.00:5:STUDENT,FREESHIP,SAVE10 Customer with highest cart value: C001 has the highest cart value of 76600.00 Customers with multi-category purchases: C001 Customers sorted by coupon usage: C003 - 3 coupons C001 - 2 coupons C002 - 1 coupons


Question 2: Hospital Patient Management System

MediCare Hospital needs a system to manage patient appointments across different departments and track doctor availability. Create a Java application for efficient patient-doctor scheduling.