-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex3.rb
More file actions
28 lines (28 loc) · 1.43 KB
/
ex3.rb
File metadata and controls
28 lines (28 loc) · 1.43 KB
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
# This line prints a string
puts "I will now count my chickens:"
# This line prints a string with an operation embedded, and will show the result of the operation
puts "Hens #{25.0 + 30.0 / 6.0}"
# This line prints a string with an operation embedded, and will show the result of the operation
puts "Roosters #{100.0 - 25.0 * 3.0 % 4.0}"
# This line prints a string
puts "Now I will count the eggs:"
# This line print the results of an operation
puts 3.0 + 2.0 + 1.0 - 5.0 + 4.0 % 2.0 - 1.0 / 4.0 + 6.0
# This line prints a string
puts "Is it true that 3.0 + 2.0 < 5.0 - 7.0?"
# This line print the results of an operation
puts 3.0 + 2.0 < 5.0 - 7.0
# This line prints a string with an operation embedded, and will show the result of the operation
puts "What is 3.0 + 2.0? #{3.0 + 2.0}"
# This line prints a string with an operation embedded, and will show the result of the operation
puts "What is 5.0 - 7.0? #{5.0 - 7.0}"
# This line prints a string
puts "Oh, that's why it's false."
# This line prints a string
puts "How about some more."
# This line prints a string with an operation embedded, and will show the result of the operation
puts "Is it greater? #{5.0 > -2.0}"
# This line prints a string with an operation embedded, and will show the result of the operation
puts "Is it greater or equal? #{5.0 >= -2.0}"
# This line prints a string with an operation embedded, and will show the result of the operation
puts "Is it less or equal? #{ 5.0 <= -2.0}"