// ANDExample
boolean x = true;
boolean y = false;
boolean z = x && y;
System.out.println(z);


// ANDTemperatureHumidityExample
int temperature = 81;
int humidity = 99;
if ((temperature > 80) && (humidity > 90))
{
	System.out.println("It's not just the heat, it's the humidity!");
}




// ORExample
boolean x = true;
boolean y = false;
boolean z = x || y;
System.out.println(z);


// ORMilesMonthsExample
int miles = 2500;
int months = 5;
if ((miles > 3000) || (months > 3))
{
	System.out.println("Your car warranty has expired!");
}



// NOTExample
boolean x = true;
boolean y = !x;
System.out.println(y);



// NOTPasswordExample
String password;
password = new String("Wrong Password");
// Later
if (!password.equals("open sesame"))
{
	System.out.println("Sorry, incorrect password.");
}



// XORExample
boolean x = true;
boolean y = false;
boolean z = x ^ y;
System.out.println(z);



// XORCakeExample
boolean haveCake;
boolean wantToEatCake;
haveCake = true;
wantToEatCake = true;
// Later
if (haveCake ^ wantToEatCake)
	System.out.println("You're OK!");
else
	System.out.println("You can't have your cake and eat it too!");




// ANDExerciseExample1
boolean b1 = true;	// Change as needed.
boolean b2 = false;	// Change as needed.
if (b1 && b2)
	System.out.println("Yes");
else
	System.out.println("No");




// ANDExerciseExample2
int x = 0;
int y = 10;
while ((x < 5) && (y > 5))
{
	System.out.println("x = " + x);
	System.out.println("y = " + y);
	x++;
	y = y - 5;
}



// ORExerciseExample1
boolean b1 = true;	// Change as needed.
boolean b2 = false;	// Change as needed.
if (b1 || b2)
	System.out.println("Yes");
else
	System.out.println("No");



// ORExerciseExample2
int x = 0;
int y = 10;
while ((x < 5) || (y > 5))
{
	System.out.println("x = " + x);
	System.out.println("y = " + y);
	x++;
	y = y - 5;
}





// XORExerciseExample1
boolean b1 = true;	// Change as needed.
boolean b2 = false;	// Change as needed.
if (b1 ^ b2)
	System.out.println("Yes");
else
	System.out.println("No");



// XORExerciseExample2
int x = 0;
int y = 10;
while ((x < 5) ^ (y < 5))
{
	System.out.println("x = " + x);
	System.out.println("y = " + y);
	x++;
	y = y - 5;
}




// ParenthesisExample
boolean b1, b2, b3;
b1 = true;	// Change as needed.
b2 = true;	// Change as needed.
b3 = true;	// Change as needed.
// Later
if (b1 && (b2 || b3))
	System.out.println("Yes");
else
	System.out.println("No");




// ScholarshipExample
boolean isAthlete;
int SAT;
int familyIncome;
isAthlete = true;		// Change as needed.
SAT = 1200;			// Change as needed.
familyIncome = 100000;		// Change as needed.
if (isAthlete || (SAT > 1400) || (familyIncome < 30000))
{
	System.out.println("Scholarship");
}




// MowTheLawnExample
// Define variables.  Perhaps define one more to help
String days[] =
	{"Sunday", "Monday", "Tuesday",
	"Wednesday", "Thursday", "Friday", "Saturday"};
String today;	// The day of the week.  e.g. "Monday"
int timeHour;	// The hour of the time in 24 hour format.
// Place your code here.  Hint: nested for loops.
for (int i=0; i<days.length; i++)
{
	today = days[i];
	for (timeHour=0; timeHour<24; timeHour++)
	{
		System.out.print("today is " + today);
		System.out.print(", time is " + timeHour);
		System.out.print(":00.  ");
		boolean isSaturday = today.equals("Saturday");
		boolean isSunday = today.equals("Sunday");
		boolean afterTen = timeHour >= 10;
		boolean beforeFour = timeHour < 16;
		if ((isSaturday || isSunday) && (afterTen && beforeFour))
			System.out.println("Mow the lawn.");
		else
			System.out.println("Do not mow the lawn!");
	}
}



