Bird watcher

in #italast month

using System;

class BirdCount
{
public int[] birdsPerDay = new int[7] { 0, 2, 5, 3, 7, 8, 4 };

public BirdCount(int[] birdsPerDay)
{
    this.birdsPerDay = birdsPerDay;
}

public static int[] LastWeek()
{
   int[] birdsPerDay1 = new int[7] { 0, 2, 5, 3, 7, 8, 4 };
   return birdsPerDay1;
}

public int Today()
{
    return birdsPerDay[birdsPerDay.Length-1];
}

public void IncrementTodaysCount()
{
    int today=Today();
    today = today+1;
    birdsPerDay[birdsPerDay.Length-1]= today;
}

public bool HasDayWithoutBirds()
{
   // al posto di un for con un if dentro:https://stackoverflow.com/questions/21197410/c-sharp-compiler-error-not-all-code-paths-return-a-value
    return System.Array.IndexOf(birdsPerDay, 0) >= 0;
}

public int CountForFirstDays(int numberOfDays)
{
    int visitingBirds = 0;
    for (int i=0; i<= numberOfDays-1; i++)
    {
        visitingBirds += birdsPerDay[i];
    }
    return visitingBirds;
}

public int BusyDays()
{
    int busyDays = 0;
    for (int i=0; i<= birdsPerDay.Length-1; i++)
    {
        if(birdsPerDay[i] >= 5)
        busyDays += 1;
    }
    return busyDays;
}

}

Sort:  

Thank you, friend!
I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
image.png
please click it!
image.png
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)

The weight is reduced because of the lack of Voting Power. If you vote for me as a witness, you can get my little vote.

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 61674.06
ETH 3067.94
USDT 1.00
SBD 3.81