Created
August 12, 2013 12:39
-
-
Save ksolo/6210494 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////// Your Code /////////////////////////////////////////////// | |
/////// Driver Code ///////////////////////////////////////////// | |
var tree = new OrangeTree(); | |
while (!tree.hasOranges()) { | |
tree.incrementAge(); | |
} | |
console.log("Tree is " + tree.age + " years old and " + tree.height/12 + " feet tall"); | |
while(tree.isAlive()) { | |
var basket = []; | |
while(tree.hasOranges()) { | |
basket.push(tree.pickOrange()); | |
} | |
var avgDiameter = function() { | |
// create this method | |
}; | |
console.log("Year " + tree.age + " Report"); | |
console.log("Tree height: " + tree.height + " feet"); | |
console.log("Harvest: " + basket.length + " oranges with an average diameter of " + avgDiameter() + " inches"); | |
console.log(""); | |
tree.incrementAge(); | |
} | |
console.log("Alas, the tree, she is dead!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment