Skip to content

Instantly share code, notes, and snippets.

@courtney-scripted
Created March 28, 2018 15:43
Show Gist options
  • Save courtney-scripted/8b86c17d172873c7f73fc6005f200367 to your computer and use it in GitHub Desktop.
Save courtney-scripted/8b86c17d172873c7f73fc6005f200367 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=8b86c17d172873c7f73fc6005f200367

Ever been bored? Don't know what to do? We're here to help! Next week is Spring break and we want to make sure you have LOTS of fun.

You're job is to create a "Spring Break Plan" generator. You'll enter information about what day of the week it is and what the weather is like and we'll tell you what to do. *If it’s Saturday and it’s sunny, I’ll go for a bike ride. *If it’s Saturday and it’s cloudy, I’ll binge watch Netflix. *If it’s Sunday and it’s sunny, I’ll go to the park. *If it’s Sunday and it’s cloudy, I’ll binge watch Netflix. *Otherwise, I’ll stay inside.

<!DOCTYPE html>
<html>
<head>
<title>09.4 Compound Conditionals Spring Break Generator</title>
</head>
<body>
<h1> Spring Break Plan Generator </h1>
<p> Ever been bored? Can't decide what to do? We're here to help! </p>
<img src="http://gifimage.net/wp-content/uploads/2017/06/bored-gif-12.gif">
<h3> Day of the Week </h3>
<p> Is it Saturday or Sunday? </p>
<input id="dayOfWeek">
<h3> Weather </h3>
<p> Is it sunny or cloudy? </p>
<input id="weather">
<button> Submit </button>
<p id="result"> </p>
</body>
</html>
{"enabledLibraries":["jquery"],"hiddenUIComponents":["editor.css","console"]}
$("button").click(function(){
var dayOfWeek = $("#dayOfWeek").val();
var weather = $("#weather").val();
//Create a compound conditional statement below.
//Lines 12-14 will have to be used in the conditional statement. Feel free to re-arrange.
$("#result").html("I'll go for a bike ride.");
$("#result").html("I'll go binge watch Netflix.");
$("#result").html("I'll go to the park.");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment