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
#include <iostream> | |
#include <string> | |
#include <iomanip> | |
#include <fstream> | |
#include <cmath> |
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
#include <iostream> | |
#include <string> | |
using namespace std; | |
bool isVowel(char range); | |
int main() { | |
string usrInpt; |
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
#include <iostream> | |
#include <string> | |
#include <iomanip> | |
using namespace std; | |
int main() { | |
int num; |
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
//File I/O in 5 steps | |
#include <iostream> | |
#include <string> | |
#include <fstream> //Step 1)Include the header file fstream in the program. | |
#include <iomanip> | |
using namespace std; |
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
** Invoke db:reset (first_time) | |
** Invoke db:drop (first_time) | |
** Invoke db:load_config (first_time) | |
** Execute db:load_config | |
** Invoke db:check_protected_environments (first_time) | |
** Invoke environment (first_time) | |
** Execute environment | |
** Invoke db:load_config | |
** Execute db:check_protected_environments | |
** Execute db:drop |
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
[14] pry(#<Post>):1> nesting | |
Nesting status: | |
-- | |
0. main (Pry top level) | |
1. #<Post> | |
[15] pry(#<Post>):1> self.title = "my new title" | |
=> "my new title" | |
[16] pry(#<Post>):1> self.body = "My new body" | |
=> "My new body" | |
[17] pry(#<Post>):1> save! |
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
<html> | |
<head> | |
<style> | |
body { | |
background-color: #1f1f2e; | |
margin: 0px; | |
padding: 0px; | |
} | |
#gameConsole { |
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
INSTRUCTIONS | |
[2,4,6].each_with_index do |element, index| | |
p "#{element} is at position #{index}" | |
end | |
Write a method, add_value_and_index, that takes an array of numbers and returns a new array composed of the value-plus-the-index of each element in the argument array: | |
add_value_and_index([2,4,6]) | |
#=> 2,5,8 | |
SPECS |
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
class BankAccount | |
attr_reader :balance, :number_of_withdrawals | |
def initialize(balance) #constructor | |
@balance = balance | |
@number_of_withdrawals = 0 | |
end | |
def display_balance | |
@balance |
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
=begin | |
Define a class called CheckingAccount that inherits from BankAccount. | |
Write it so that if more than 3 withdrawals are made, it charges a $5 | |
fee for each transaction afterwards. Use a constant called | |
MAX_FREE_WITHDRAWALS to set the maximum number of withdrawals before the | |
fee kicks in. Define a method called get_free_withdrawal_limit to expose | |
the value of the constant. If there aren't enough funds to cover the fee | |
and the limit has been reached, it should not make a successful | |
withdrawal. The class should also have a transfer method that uses an | |
account to move money from, and an amount to transfer as arguments and |