merge develop into main #1

Merged
Sadra3st merged 3 commits from develop into main 2026-06-10 05:16:41 +00:00
Showing only changes of commit e4d0d6febb - Show all commits
+13 -8
View File
@@ -15,15 +15,20 @@ public class Main {
}
Scanner scanner = new Scanner(input);
// TODO:
// - Read each line from products.csv
// - For each line, parse productId, name, and price
// - The format of the file is like this:
// [productId],[name],[price]
// - Store Product objects in the productCatalog ArrayList
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
// NOTE
// - The data in products.csv is guaranteed to be valid.
String[] parts = line.split(",");
int productId = Integer.parseInt(parts[0].trim());
String productName = parts[1].trim();
double productPrice = Double.parseDouble(parts[2].trim());
Product product = new Product(productId, productName, productPrice);
productCatalog.add(product);
}
scanner.close();
}
public static void main(String[] args)