Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Currently have the following: public void setQty(int quantity) { this.quantity =

ID: 3543226 • Letter: C

Question

Currently have the following:


    public void setQty(int quantity)

    {

       this.quantity = quantity;

    }


and


    public void setItemCost(Money cost)

    {

       this.cost = cost;

    }


Having trouble writing the code to multiple "Money" and "int". Was told the action can be added to the return statement. "return ???". Need to complete the following action.


    /**

     * Calculates the cost of the lot. This value is calculated by

     * multiplying the number of items in the lot by the cost of an

     * item. Calculation is done using Money's operation.  

     * Check Money's JavaDoc for details.

     *

     * @return the cost of the lot.

     */

    public Money computeCost()

    {

       return ??

    }

Explanation / Answer

You have to give complete code. What all fields money constructor has? It ll be typecasted. Let me know. I ll help

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote