This file contains hidden or 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
def addition_function # declare this outside of the case and loop so we can call it repeatedly | |
puts "Which numbers would you like to add?" | |
n1 = gets.chomp.to_i | |
n2 = gets.chomp.to_i | |
answer = n1 + n2 | |
puts "The sum is: #{answer}" | |
end | |
def show_menu | |
puts "Calculator" |
This file contains hidden or 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
$(document).ready(function() { | |
const balance = { | |
savings: 0, | |
checking: 0 | |
}; | |
//CHANGING COLOR ON $0... | |
const zeroBalance = function() { | |
if (balance['savings'] === 0) { |
This file contains hidden or 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
// sum shopping cart items js | |
// shopping cart object | |
const cartForParty = { | |
banana: "1.25", | |
handkerchief: ".99", | |
Tshirt: "25.01", | |
apple: "0.60", | |
nalgene: "10.34", | |
proteinShake: "22.36" |