Challenges from last time:
- From an interview with Google (not mine): Suppose you were shrunk to the size of a nickel. Your mass was shrunk as well, so your density is the same. You are thrown into a blender, the blades are about to start spinning; what do you do?
- From an interview with Microsoft (not mine): Suppose you're locked in a building and can't leave. How many ways can you think of to measure the exterior temperature?
Warm Up
Write in JavaScript the code for finding the minimum of 5
variables, call them a1,a2,a3,a4,a5. You can assume that
these variables are given to you. Use the alert() function
to display the result. Example:
alert('"' + a1 + '" is the smallest number!<br/>');
Computer Science
Last time we created an expert system for determining what parts of computer science you could potentially be interested in. This time you will take the diagram below and translate it into JavaScript. The point of this exersize is to use if, else if, esle statements. The states in bold are end states, and their contents should be output via the alert() function.
A challenge for next time
From my interview with Lawrence Livermore National Labs over this
weekend:
You have a bowl with 200 fish in it. Of these fish 99% are not
guppies. how many fish should you remove so that 2% of what remains
are guppies? Suppose you can distinguish guppies from non-guppies.