# Population Trait Counter

We can observe populations (of people, of animals, of pine cones, **of turtles**)  and  record their different traits. When scientists are observing they often use digital devices to record what they observe in real time.

![](https://2507214486-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpUPSf3tCxHePJxNjfg%2F-Lta8Fw5tQFIRlmoLMOr%2F-Lta8X032OmDiagtZJc9%2Fimage.png?alt=media\&token=e4b47488-2816-4554-a619-c514b3c5397b)

First identify a population trait of the green turtle (hint look them up). For example: turtles with spots or turtles without spots. We are looking for a trait that one turtle cannot have BOTH  (can't have spots and NOT have spots). These are binary conditions: Alive or Dead, True or False, Chicken or Egg. Then create a Population Trait Counter&#x20;

```
On Start:
   total = 0
   //total number of turtles seen
   trait1 = 0 
   //change name to the trait you are counting
   //turtles with spots
   trait2 =  0 
   //change name to the trait you are observing
   //turtles without spots
   display: Turtle Population Trait Counter
```

&#x20;The above section of code declares the variables and sets their starting values = 0

Button A = `Trait 1`.  When button A is clicked the value of `trait1` should increase by `1` and then display a check mark (or some other symbol to indicate that the trait has been counted.&#x20;

**TIP**: Consider adding a clear screen after a pause so that there is a clear indicator that a trait has been counted.&#x20;

Button  B = `Trait 2` - it should work exactly like `trait1`

**TIP**: Consider using a different symbol so that the scientist can be sure that the 2nd trait was counted&#x20;

```
On Shake
    total = trait1 + trait2
    //this should equal all the turtles you have seen
    Then Use LED Panel to Communicate results of
        Total 
        Trait1
        Trait2
```

```
A+B Pressed
    reset all variables back to 0
    Communicate the reset using words or sybmols
```
