Java Java
Java Java
*;
class MyClass {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
sc.close();
}
int count = 0;
for (Laptop laptop : laptops) {
// Check for matching brand (case insensitive) and rating greater than
3
if (laptop.getBrand().equalsIgnoreCase(brand) && laptop.getRating() >
3) {
count++;
}
}
return count;
}
public Laptop(int laptopId, String brand, String osType, double price, int
rating) {
this.laptopId = laptopId;
this.brand = brand;
this.osType = osType;
this.price = price;
this.rating = rating;
}