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
# Ruby Getting Started with Programming | |
# A Codecademy Ruby (Putting the Form in Formatter) assignment | |
# Dr. Steven B. Combs, coding novice | |
# gets requests user input and the .chomp modifier excludes new/blank line that ruby includes by default | |
#request input | |
print "What's your first name?" | |
first_name = gets.chomp.capitalize! # Replaces first_name variable with first character capitalized version | |
print "What's your last name?" |
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
# Computer the bill for a shopping list | |
# A Codecademy Python (Stocking Out) assignment | |
# Dr. Steven B. Combs, coding novice | |
shopping_list = ["banana", "orange", "apple", "orange", "apple"] | |
stock = { | |
"banana": 6, | |
"apple": 0, | |
"orange": 32, | |
"pear": 15 |
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
// Javascript Getting Started with Programming | |
// A Codecademy Javascript (Prototype Practice - Objects) assignment | |
// Dr. Steven B. Combs, coding novice | |
function Cat(name, breed) { | |
this.name = name; | |
this.breed = breed; | |
} | |
// Cat Objects |
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
// Javascript Getting Started with Programming | |
// A Codecademy Javascript (Getting IN-timate) assignment | |
// Dr. Steven B. Combs, coding novice | |
var nyc = { | |
fullName: "New York City", | |
mayor: "Michael Bloomberg", | |
population: 8000000, | |
boroughs: 5 | |
}; |
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
// Javascript Getting Started with Programming | |
// A Codecademy Javascript (I.D. Please and Know Thyself) assignments | |
// Dr. Steven B. Combs, coding novice | |
var anObj = { job: "I'm an object!" }; | |
var aNumber = 42; | |
var aString = "I'm a string!"; | |
// typeof identifies the type from an object, number variable or string variable | |
console.log(typeof anObj); // will print "object" |
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
// Javascript Getting Started with Programming | |
// A Codecademy Javascript (Literally Speaking) assignment | |
// Dr. Steven B. Combs, coding novice | |
// Object with method (function) using Literal Constrution | |
var james = { | |
job: "programmer", | |
married: false, | |
speak: function() { | |
console.log("Hello, I am feeling great"); |
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
// Javascript Getting Started with Programming | |
// A Codecademy Javascript (Fun with Functions) assignment | |
// Dr. Steven B. Combs, coding novice | |
// Constructor object notation | |
function Person(job, married) { | |
this.job = job; | |
this.married = married; | |
this.speak = function () { // Object with function (or method when a part of an object) | |
console.log ("Hello!"); |
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
// Javascript Getting Started with Programming | |
// A Codecademy Javascript (An Object Review) assignment | |
// Dr. Steven B. Combs, coding novice | |
// Create Object Template | |
function Person(job, married) { | |
this.job = job; | |
this.married = married; | |
} |
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
// Javascript Getting Started with Programming | |
// A Codecademy Javascript (Findng the Special Someone) assignment | |
// Dr. Steven B. Combs, coding novice | |
var bob = { | |
firstName: "Bob", | |
lastName: "Jones", | |
phoneNumber: "(650) 777-7777", | |
email: "bob.jones@example.com" | |
}; |
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
// Javascript Getting Started with Programming | |
// A Codecademy Javascript (ListingEveryone) assignment | |
// Dr. Steven B. Combs, coding novice | |
var bob = { | |
firstName: "Bob", | |
lastName: "Jones", | |
phoneNumber: "(650) 777-7777", | |
email: "bob.jones@example.com" | |
}; |