Questions and Answers
Problems and Solutions
Quotes help make search much faster. Example: "Practice Makes Perfect"
Wednesday, January 23, 2013
Private Affairs
#Codecademy sample solution
class Account
attr_reader :name
attr_reader :balance
def initialize(name, balance=100)
@name = name
@balance = balance
end
private
def pin
@pin = 1234
end
def pin_error
return "Access denied: incorrect PIN."
end
end
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 Sample Solution: Final Push
$VERBOSE = nil # We'll explain this at the end of the lesson. require 'prime' # This is a module. We'll cover these s...
Math Problems: Collatz Function
Problem: The Collatz function is defined as f(n) = 3n+1 for odd values of n and f(n) = n/2 for even values of n. What is the smallest poss...
#Codeschool CSS Level 1 Sample Solution Floats
//sample solution to style.css aside { width: 120px; float: right; margin: 0px 0px 10px 10px; }
Codecademy Learn Statistics With Python Histograms Exercise 3/9
# Sample Solution # Import packages import numpy as np import pandas as pd # Read in transactions data transactions = pd.read_csv(...
Codeyear: The Headless Table of Sleepy Hollow
<!--sample solution--> <html> <head> <title>Doubling the Chocolate Chip Cookies Recipe</title>...
Codecademy > Learn Java > Comments Sample Solution
public class Comments { public static void main(String[] args) { //System.out.println("Noise!"); /* anything you l...
Codeschool Sample Solution Removing the clicked button
$(document).ready(function(){ $("button").on("click", function(){ var message = $("<span>Call 1-555-...
Make a Website: HTML Wrap with a div 5/9
<!-- Sample solution to index.html --> <!DOCTYPE html> <html> <body> <div class="nav"> ...
LearnStreet Sample Solution Sudoku Solver Project Method 1
// Sudoku Solver Project function isPossibleRow(sudoku, row, number) { // This isPossibleRow() function returns true if the 'numbe...
Codecademy Learn Statistics With Python Histograms Exercise 4/9
# Sample Solution # Import packages import numpy as np import pandas as pd # Array of days old bread days_old_bread = np.array([0, 8, ...
No comments:
Post a Comment