· 8 years ago · May 04, 2018, 06:28 AM
1#what is the users name?
2puts("What's your name?")
3 name = gets
4
5#what is the user's favorite email provider?
6puts("\nSo #{name.strip}, what is your favorite email provider? i.e. gmail.comn\n")
7 provider = gets
8
9#what a coincedence!
10if provider.strip == "gmail.com"
11
12 puts("\nWhat a coincidence! I use gmail to!\n")
13
14 else puts("\n#{provider.strip}? that's a nice one, but I wouldn't choose that one.\n")
15
16end
17
18#what is the user's middle and last initial?
19puts("So, #{name.strip}, what is your middle name or initial?\n")
20 middle = gets
21
22puts("\nAnd your last name or initial?\n")
23 last = gets
24
25#so is your email anything like...?
26puts("\nHmm...so is your email address anything like #{name.strip}.#{middle.strip}#{last.strip}@#{provider.strip}?\n")
27 answer = gets
28
29if answer.strip == "yes"
30 puts("\nI knew it!")
31
32 else if answer.strip == "no"
33 puts("\nOh, well yours must not be so simple then huh?")
34
35 else
36 puts("\nThat is not a valid answer")
37#failed loop
38=begin
39 until answer == "yes" or "no"
40 puts("That is not a vailid answer")
41 puts("Is your email address anything like #{name.strip}.#{middle.strip}#{last.strip}@#{provider.strip}?")
42 answer = gets
43
44 if answer.strip == "yes"
45 puts("I knew it!")
46
47 else if answer.strip == "no"
48 puts("Oh, well yours must not be so simple then huh?")
49
50 else
51 puts("That is not a valid answer")
52=end
53end
54end
55
56print("unce unce unce unce unce")