Rhea Rajashekhar P4 Popcorn Hacks 3.7

weather = "sunny"
transportation = "available"
boots = "not present"
water = "brought"  # New Variable
sunscreen = "applied"  # New Variable

print("The weather is " + weather)
print("Your transportation is " + transportation)
print("Your boots are " + boots)
print("Your water is " + water)
print("Your sunscreen is " + sunscreen)

if weather == "sunny":
    if transportation == "available":
        if boots == "present":
            if water == "brought" and sunscreen == "applied":  # New Conditionals
                print("You are fully ready to go hiking!")
            else:
                print("Make sure to bring water and apply sunscreen.")
        else:
            print("You need to find your boots first.")
    else:
        print("You need to arrange transportation.")
else:
    print("It's not good weather for hiking.")
Python homework hack 1
weather = "sunny"  # Can be "sunny" or something else
sunscreen = "have"  # Can be "have" or "not have"
snacks = "enough"  # Can be "enough" or "not enough"

if weather == "sunny":
    if sunscreen == "have":
        if snacks == "enough":
            print("You are ready for the beach!")
        else:
            print("You need to get more snacks first.")
    else:
        print("You need to buy sunscreen.")
else:
    print("It's not a good day for the beach.")

python homework hack 2
at_least_18_yrs_old = True
at_least_50_sqr_ft = True
possible_pet_care = True

if at_least_18_yrs_old:
    if at_least_50_sqr_ft:
        if possible_pet_care:
            print("You can adopt a pet!")
        else:
            print("You must be able to make time for the pet.")
    else:
        print("You must have a bigger home.")
else:
    print("You must be 18 to adopt a pet.")
# python homework hack 3
weather_clear = True
have_running_shoes = True
ten_days_of_practice = True

if weather_clear:
    if have_running_shoes:
        if ten_days_of_practice:
            print("You are ready for the marathon.")
        else:
            print("You need to practice more.")
    else:
        print("You need to buy running shoes.")
else:
    print("It is not the right time for a marathon.")
%% js 
// popcorn hack 1
let weather = "sunny";
let transportation = "available";
let boots = "not present";
let water = "brought";  // New condition
let sunscreen = "applied";  // New condition

console.log("The weather is " + weather);
console.log("Your transportation is " + transportation);
console.log("Your boots are " + boots);
console.log("Your water is " + water);
console.log("Your sunscreen is " + sunscreen);

if (weather === "sunny") {
    if (transportation === "available") {
        if (boots === "present") {
            if (water === "brought" && sunscreen === "applied") {
                console.log("You are fully ready to go hiking!");
            } else {
                console.log("Make sure to bring water and apply sunscreen.");
            }
        } else {
            console.log("You need to find your boots first.");
        }
    } else {
        console.log("You need to arrange transportation.");
    }
} else {
    console.log("It's not good weather for hiking.");
}
%% js 
// popcorn hack 2
let living_room_available = true;
let projector_working = true;  // Changed from false to true
let enough_snacks = false;  // Changed from true to false

if (living_room_available) {
    if (projector_working) {
        if (enough_snacks) {
            console.log("You're ready to host the movie night!");
        } else {
            console.log("You need to get more snacks. Ideas: Popcorn, Candy, Soda");
        }
    } else {
        console.log("You need to fix or replace the projector.");
    }
} else {
    console.log("The living room is not available for the movie night. Find another room!");
}
%% js 
// homework hack 1
let hasMaterials = true;
let quietPlace = true;
let isTired = false;

if (hasMaterials) {
    if (quietPlace) {
        if (!isTired) {
            console.log("You are ready to study!");
        } else {
            console.log("You should take a nap or rest before studying.");
        }
    } else {
        console.log("You need to find a quiet place to study.");
    }
} else {
    console.log("You need to gather your study materials first.");
}

%% js 
// homework hack 2
let hasFlour = true;
let hasEggs = true;
let hasSugar = false;
let ovenWorking = true;
let timeAvailable = 2.5;

if (hasFlour && hasEggs && hasSugar) {
    if (ovenWorking) {
        if (timeAvailable >= 2) {
            console.log("You can start baking the cake!");
        } else {
            console.log("You need to find more time to bake and cool the cake.");
        }
    } else {
        console.log("You need to fix or replace the oven.");
    }
} else {
    let missingIngredients = [];
    if (!hasFlour) missingIngredients.push("flour");
    if (!hasEggs) missingIngredients.push("eggs");
    if (!hasSugar) missingIngredients.push("sugar");
    
    console.log("You are missing the following ingredients: " + missingIngredients.join(", "));
}
%% js 
// homework hack 3
let weather = "clear";
let hasTent = true;
let enoughFoodAndWater = false;

if (weather === "clear") {
    if (hasTent) {
        if (enoughFoodAndWater) {
            console.log("You are ready to go camping!");
        } else {
            console.log("You need to pack more food and water.");
        }
    } else {
        console.log("You need to buy or borrow a tent.");
    }
} else {
    console.log("It's not a good time for camping due to the weather.");
}