repl.it
Ruby

No description

fork
loading
Files
  • main.rb
main.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
-puts 'Welcome to McDonalds.'
sleep (1)
puts 'You have $10.'
sleep (1)
puts 'What would you like?'
puts '_________________________________________
|               Menu                    |
|   1.Big Mac                $10.00     |
|   2.Cheese Burger          $3.00      |
|   3.Double Cheese Burger   $6.00      |
|   4.Triple Cheese Burger   $9.00      |
|   5.Chicken Salad          $5.00      |
|                                       |
|_______________________________________|'
input = gets.chomp
if input == '1'
puts 'You ordered a Big Mac.'
sleep (5)
puts 'Order up.'
sleep (2)
end
if input == '2'
puts 'You ordered a Cheese Burger.'
sleep (5)
puts 'Order up.'
sleep (2)
end
if input == '3'
puts 'You ordered a Double Cheese Burger.'
sleep (5)
puts 'Order up.'
sleep (2)
end
if input == '4'
puts 'You ordered a Triple Cheese Burger.'
sleep (5)
puts 'Order up.'
sleep (2)
end
if input == '5'
puts 'You ordered a Chicken Salad.'
sleep (5)
puts 'Order up.'
sleep (2)
end
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]
?