Skip to content

Instantly share code, notes, and snippets.

@outoftime
Last active February 8, 2018 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save outoftime/9e7224a8ec8d3f2d33b370cf7eeb8236 to your computer and use it in GitHub Desktop.
Save outoftime/9e7224a8ec8d3f2d33b370cf7eeb8236 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=9e7224a8ec8d3f2d33b370cf7eeb8236

Weekend Plan Generator

Give the user some advice on what to do this weekend!

Given the weather and day, advise these activities:

  • If it’s Saturday and it’s sunny, go for a bike ride.
  • If it’s Saturday and it’s cloudy, binge watch Netflix.
  • If it’s Sunday and it’s sunny, go to the park.
  • If it’s Sunday and it’s cloudy, go to the Natural History Museum.
  • Otherwise, stay inside and practice coding!
<!DOCTYPE html>
<html>
<head>
<title>09.4 Compound Conditionals Weekend Plan Generator</title>
</head>
<body>
<h1> Weekend 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();
// Write your code here
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment