1. Store alb("Albertson's"); double totalLost = 0; // will be positive or zero for (int p = 0; p < alb.getProductCount(); p++) { Product prod = alb.getProduct(p); if (prod.onSale() && prod.getPrice() < prod.getCost()) { totalLost += prod.unitsSold() * (prod.getCost()-prod.getPrice()); } } cout << "$" << totalLost; 2. int total = 0; for (int c = 0; c < numCols; c++) { total += data[0][c]; // catch top row total += data[numRows-1][c]; // catch bottom row } for (int r = 1; r < numRows-1; r++) { // avoid top & bottom total += data[r][0]; // left column total += data[r][numCols-1]; // right column } cout << total; 3. ifstream infile("input.txt"); char str1[MAX],str2[MAX]; infile >> str1 >> str2; if (strcmp(str1, str2) == 0) { cout << "same"; } else { cout << "not same"; } 4. void makeAssign(Assignment newAssg) { Map map; int bestTeamIndex = -1; double closestDistance; for (int t = 0; t < teamCount; t++) { if (teams[t].getCurrAssign().getPriority() < newAssg.getPriority()) { // team is available double thisTeamDistance = map.getDistance( teams[t].getLoc(),newAssg.getLoc()); if (bestTeamIndex == -1 || thisTeamDistance < closestDistance) { bestTeamIndex = t; closestDistance = thisTeamDistance; } } } if (bestTeamIndex == -1) cout << "No available team"; else teams[bestTeamIndex].setCurrAssign(newAssg); } 5. OUTPUT: Soith 20 OUTPUT: Jones 40 OUTPUT: Zvans 59 OUTPUT: Thomas 80