Hello all,
I am trying to write a program using ruby, that notifies individuals of certain things that they have been selected for. The way that I am writing this is by using 3 arrays to store the following:
1. dates
2. names
3. email addresses
I then want to merge each record of the array into pre-defined text. Eventally I will want to get this to the point where I can send this via e mail once its done but a little at a time
note:
I do understand that the program is probably not written in the best way but I am just learning so I am not looking to take the shortest route, just to make a functional program, then to shorten it later as I understand things.
program (example)
names_array = []
emails_array = []
dates_array =[]
puts 'Enter name(s) of the person(s) that will be having the day off'
name_input = gets.chomp
while (name_input != '')
names_array [names_array.length] = name_input
name_input = gets.chomp
end
puts 'Enter the email address(es) of the person(s) that will be having the day off'
email_input = gets.chomp
while (email_input != '')
emails_array[emails_array.length] = email_input
email_input = gets.chomp
end
puts 'Enter the date the person who will be having the day off'
date_input = gets.chomp.to_s
while (date_input != '')
dates_array[dates_array.length] = date_input
date_input = gets.chomp
end
while (?) # Can't seem to figure this part out
puts 'Dear ' + names_array[0] # Can't seem to figure this part out.
puty ''
puts 'You have been selected to win a day off on ' +dates_array[0].to_s+ '. You will have a full day of doing nothing and relaxing as you see fit. If you have any questions, please feel free to contact me at my email address user@isp.com.'
puty ''
puty ''
puts 'Thanks'
end