Questions and Answers
Problems and Solutions
Quotes help make search much faster. Example: "Practice Makes Perfect"
Monday, December 3, 2012
Codecademy: Codeyear Nested Conditionals: Part 1
//sample solution
var cost = 1000;
var employed = "yes";
var result;
if (cost > 100) {
if (employed === "yes") {
result = "buy";
} else {
result = "can't afford";
}
}
else {
result = "reject cheap product";
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
This is an example of
scrolling text
using Javascript.
Popular Posts
Codecademy > Learn Java > Methods: II Sample Solution
class Dog{ int age; public Dog(int dogsAge){ age = dogsAge; } public void bark() { System.out.println("Woof...
Codecademy Using Documentation 7/8
// Sample Solution using System; namespace DocumentationHunt { class Program { static void Main(string[] args) { ...
Codeyear: Creating an array with recursion
//sample solution // Here is the array we will store results in var multiples = []; function multiplesOf(base, i) { // Base case ...
LearnStreet Python Lesson 9 Exercise 8
#sample solution def run(bottle): #your code here bottle.drink(250) bottle.refill(150) return bottle.amount_left cl...
Codecademy About You Exercises 1 to 4
<!-- sample solutions to Welcome to HTML! --> <h1>Bruce Wayne</h1> <!-- sample solutions to Speak in Paragraphs --> ...
Codecademy: factorial
#sample solution def factorial(x): x = abs(x) #prevents error on negative numbers product = 1 for i in range(x): product = prod...
Codecademy Comparison Operators 3/6
// Sample Solution using System; namespace ComparisonOperators { class Program { static void Main(string[] args) { ...
Codecademy: Sample Solution to "Getting Pickyer"
//Sample solution to script.js $('document').ready(function() { $('#emptyTrash').click(function() { //remove the elemen...
Codefights isCaseInsensitivePalindrome(inputString)
//sample solution function isCaseInsensitivePalindrome(inputString) { var temp = inputString.toLowerCase(); var tempReversed = te...
Brahmagupta's Formula For Quadrilateral Area
Question: What is the area of a quadrilateral with sides equal to 18, 22, 39, and 41 respectively? Answer: 798 console.log("******...
No comments:
Post a Comment