Count parcels after a delivery
Add what came in, then subtract what went out.
Simple example
Start2 + 3 − 1
Result4
void main() {
print(((2 + 3) - 1));
}
4
Advertisements
Everyday examples
Two boxes hold 6 and 4 parcels. Three parcels go out. How many are left?
Start6 + 4 − 3
Result7
void main() {
final first = 6;
final second = 4;
final sent = 3;
print(((first + second) - sent));
}
7