Skip to main navigationSkip to main contentSkip to footer
Wiki Cram
  • Home
  • Blog
Wiki Cram

You’re conducting a code review on this ShoppingCart class:…

You’re conducting a code review on this ShoppingCart class: public class ShoppingCart { public double totalAmount; private List items = new ArrayList(); private int Counter; public void add(String itemName, double price) { items.add(itemName); totalAmount = totalAmount + price; } public void applyDiscount() { if (totalAmount > 100) { totalAmount = totalAmount * 0.9; } if (totalAmount > 50) { totalAmount = totalAmount * 0.95; } } public int itemcount() { return items.size(); } } Identify and explain 4 issues from these categories: CS (Coding Standards): naming, formatting, documentation CG (Code Quality/General): code smells, maintainability, design FD (Functional Defects): bugs, logic errors, incorrect behavior For each issue: Identify the category (CS, CG, or FD) Explain the problem clearly Propose a concrete fix Assign severity: Critical / Major / Minor

You’re conducting a code review on this ShoppingCart class:…

Posted on: December 2, 2025 Last updated on: December 2, 2025 Written by: Anonymous Categorized in: Uncategorized
Skip back to main navigation
Powered by Studyeffect

Post navigation

Previous Post Your team implements a “quality gate” that fails the CI buil…
Next Post Assume you have the following JavaDoc for a method: /** * Ca…
  • Privacy Policy
  • Terms of Service
Copyright © 2026 WIKI CRAM — Powered by NanoSpace