Skip to content

Instantly share code, notes, and snippets.

View ChantalDemissie's full-sized avatar

Chantal Demissie ChantalDemissie

View GitHub Profile
#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"
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}!"
#1
puts "please enter a number"
number = gets.chomp.to_i
if number > 70
puts "passing"
else number > 70
puts "not passing"
end
#2
@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"
@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
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 / electiontime.rb
Created January 21, 2019 08:12
Election program assignment
puts "Welcome to the best pet voting program."
puts "Pet candidates are: Dogs, Cats, Rodents ."
puts ""
puts "Which pet has your vote?"
puts ""
puts "Type in the species or use these shortcut letters for our friends with paws:"
puts "For Dogs, type: d"
puts "For Cats, type: c"
puts "For Rodents, type: r"
# problem 1
puts "hello there please enter 5 names seperated by spaces"
loop do
names = gets.chomp.upcase.split
if names.length >= 5
puts names[0..4]
break
else
puts "Please enter at least 5 names"
end
@ChantalDemissie
ChantalDemissie / studentaccountarray.rb
Created January 25, 2019 02:20
student account generator array
#Assignment: Student Account Generator
num_students = 5
student_names = Array.new(num_students)
student_ids = Array.new(num_students)
student_emails = Array.new(num_students)
puts "Please enter the names of students when prompted."
num_students.times do |i|
puts "First Name: "
first = gets.chomp
puts "Last Name: "
puts "How many close friends do you have?"
num_closefriends = gets.chomp.to_i
puts "Please enter the names, ages and favorite colors of your close friends"
friends = []
num_closefriends.times do
friend = {}
puts "What is your friend's name?"
friend[:name] = gets.chomp