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
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.