Question: How would you loop through the Clothing array items to calculate the total price of all items after tax? The Clothing class has a
How would you loop through the Clothing array items to calculate the total price of all items after tax? The Clothing class has a public double field price. Assume the double variables total and tax are already declared. O for (Clothing c: items) { } O for (Clothing c: items) { } total = total + c.price* (1+tax) ; } O forEach (Clothing c in items) { total += c.price* (1+tax); } total = c.price* (1+tax) ; O for (Clothing c: items []) { total = total + c.price* tax; Confirm
Step by Step Solution
3.41 Rating (151 Votes )
There are 3 Steps involved in it
The question is asking for the correct way to loop through an array of Clothing objects and to calcu... View full answer
Get step-by-step solutions from verified subject matter experts
