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
#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" |
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
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}!" |
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
#1 | |
puts "please enter a number" | |
number = gets.chomp.to_i | |
if number > 70 | |
puts "passing" | |
else number > 70 | |
puts "not passing" | |
end | |
#2 |
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
#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" |
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
#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 |
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
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 \ |
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
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" |
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
# 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 |
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
#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: " |
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
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 |
OlderNewer