Question: i'm new to java and am trying to return the value of commission to be printed out in the last line. but i keep getting the incompatible types: unexpected return value error.

```
  import java.util.Scanner;

    public class retail {
    public static void main (String[] args){

    char code;
    double commission;
    String enumber;
    double retail_price=0;
    Scanner scan = new Scanner(System.in);
    System.out.println("Enter employee number: ");
    enumber= scan.nextLine();
    System.out.println("Enter retail price: ");
    retail_price= scan.nextDouble();
    System.out.println("Enter code:");
    code=scan.next().charAt(0);
    if (code == 'A'){ commission = (retail_price/100)*6;}
    else if (code == 'a') {commission = (retail_price/100)*6;}
    else if (code == 'B') {commission = (retail_price/100)*8;}
    else if (code == 'b') {commission = (retail_price/100)*8;}
    else if (code == 'C') {commission = (retail_price/100)*10;}
    else if (code == 'c') {commission = (retail_price/100)*10;}
    else{System.out.println("Invalid code");}
    return commission;
    System.out.println("Employee number: "+enumber);
    System.out.println("Retail price: "+retail_price);
    System.out.println("Commission: "+commission);
    }
}

```

Answer: 
Extending your code:

```
from datetime import datetime, date,timedelta
from pytz import timezone

tz1 = timezone('utc')
tz2 = timezone('Asia/Kolkata')
tz3 = timezone('America/Los_Angeles')

dt1 = datetime.now(tz=tz1)
dt2 = datetime.now(tz=tz2)
print(dt1)
print(dt2)

start_of_week = dt1+timedelta(days=0-dt1.weekday())
end_of_week = dt1+timedelta(days=6-dt1.weekday())

print(start_of_week)
print(end_of_week)

```
I'm expanding chakris answer:

**updated** Since a week either can start or end on the same day, when you input sunday and the week start with sunday you have two options.

Maybe you can change the code to fit your needs.

```
from datetime import datetime, date,timedelta
from pytz import timezone

def week_startandend(dt_,weekstart=0):
    """Returns tuple with start date of week and end day of week."""
    index = (dt_.weekday() + (7-weekstart % 7) ) % 7

    # Calculate start and end
    start = dt_+timedelta(days=0-index)
    end  = dt_+timedelta(days=6-index)

    # if week doesnt start on the same day we can return
    if index != 0:
        return {"start":start.date(),"end":end.date()}
    # else we need to calculate the other option
    else:
        start2 = dt_+timedelta(days=-7)
        end2 = dt_
        return {"start1":start.date(),"end1":end.date(),
                "start2":start2.date(),"end2":end2.date()}

tz1 = timezone('utc')
tz2 = timezone('Asia/Kolkata')

dt1 = datetime.now(tz=tz1)
dt2 = datetime.now(tz=tz2)

print(week_startandend(dt1)) # defaults to 0
print(week_startandend(dt2,weekstart=6)) # 6 = sunday

```

Returns

```
{'start': datetime.date(2017, 10, 2), 'end': datetime.date(2017, 10, 8)}
{'start1': datetime.date(2017, 10, 8), 'end1': datetime.date(2017, 10, 14),
'start2': datetime.date(2017, 10, 1), 'end2': datetime.date(2017, 10, 8)}

```

In [352]: