Skip to content

Instantly share code, notes, and snippets.

View ChantalDemissie's full-sized avatar

Chantal Demissie ChantalDemissie

View GitHub Profile
puts "Hello please create a password to access your account"
puts "This must include a letter, number and special characters and be 8 or more characters"
password_is_min_length = false
password_contain_special_character = false
password_contain_number = false
special_characters = %w[@ % * !]
until password_is_min_length \
&& password_contain_special_character \
@ChantalDemissie
ChantalDemissie / day3.rb
Created January 16, 2019 06:46
day 3 exercises
#1
puts "Lets play a guessing game, Please enter a number from 0-999!"
number = (rand (0...1000))
i = 0
guess = -1
until guess == number
guess = gets.chomp.to_i
if guess > number
puts "lower"
elsif guess < number
@ChantalDemissie
ChantalDemissie / Candymachine.rb
Created January 11, 2019 08:23
candy machine
#introduction to user of candy machine program
puts "Welcome to Chantals ~New Orleans Sweets Machine~ \n How much money do you have?"
money = gets.chomp.to_f
puts "\n"
puts "That $#{money} sounds about right in this economy, here are your options!"
puts "A: $5.00 Bananas Foster"
puts "B: $3.00 Beignet"
puts "C: $4.50 Bread Pudding"
puts "D: $2.50 Praline"
#1
puts "please enter a number"
number = gets.chomp.to_i
if number > 70
puts "passing"
else number > 70
puts "not passing"
end
#2
puts "Hello I am doing an article on new students for the Ada newsletter could I collect some information for a bio?"
puts "what is your name?"
name = gets.chomp
puts "where are you from?"
hometown = gets.chomp
puts "What is your favorite thing in the world?"
favorite = gets.chomp
puts "What was your job before becoming a student at Ada?"
job = gets.chomp
puts "The new student spotlight is on #{name} from #{hometown}. Before starting at Ada Developers Academy she was working as a #{job}. If you see #{name} around make sure to say hello to our newest adie and ask about #{favorite}!"
#introduction of program
puts "<3~Welcome to Dream Date MadLib!~<3"
puts "\n"
puts "Are you ready to play? lets collect some info! Please select an answer for the following below"
#prompts user to answer questions then answers are stored for later usage in paragraph construction
puts "Your name"
name = gets.chomp
puts "Celebrity Crush"
celebrity = gets.chomp
puts "Adjective"