Add up the seats
A for-each loop runs once for every item in a list: for (Integer seat : seats) { }.
Your task
Use a for-each loop over seats to add every number to total.
String companyName = 'RidgePoint Capital';
List<Integer> seats = new List<Integer>{ 3, 5, 2 };
Integer total = 0;
Boolean reviewed = false;Requirements
- The loop should be
for (Integer seat : seats) { - Each item should be added to
totalinside the loop totalshould be0before the loop- The answer should be worked out, not typed