Code Room
Code reviewHard
Question
Review this Java code that splits an invoice total evenly across line items, in cents.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
long[] split(long totalCents, int parts) { long[] out = new long[parts]; long each = (long) (totalCents / (double) parts); for (int i = 0; i < parts; i++) { out[i] = each; } return out;}Run or narrate your approach, then ask the coach.