-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconditionals.rb
More file actions
68 lines (61 loc) · 1.35 KB
/
Copy pathconditionals.rb
File metadata and controls
68 lines (61 loc) · 1.35 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# number = gets.chomp.to_i
# if(number > 70)
# print "PASSING\n"
# else
# print "NOT PASSING\n"
# end
# answer = gets.chomp.to_s
# if(answer == "green")
# print "GO\n"
# else
# print "STOP\n"
# end
# number = gets.chomp.to_i
# if (number % 2 == 0)
# print "EVEN\n"
# else
# print "ODD\n"
# end
# number = gets.chomp.to_i
# if (number % 5 == 0)
# print "MULTIPLE OF 5\n"
# else
# print "NOT A MULTIPLE OF 5\n"
# end
# number = gets.chomp.to_i
# if (number < 10)
# print "ONE DIGIT\n"
# elsif(number >= 100)
# print "THREE DIGITS\n"
# else
# print "TWO DIGITS"
# end
# number = gets.chomp.to_i
# if(number == 12 || number == 71 || number == 80)
# print "That number is retired from the Seattle Seahawks!\n"
# end
# drink = gets.chomp.to_s
# if(drink == "SHORT")
# print "Short: 8oz\n"
# elsif(drink == "TALL")
# print "Tall: 12oz\n"
# elsif(drink == "GRANDE")
# print "Grande: 16oz\n"
# elsif(drink == "VENTI")
# print "Venti: 20oz\n"
# end
print "Enter your hourly rate: "
rate = gets.chomp.to_f
print "Enter your total hours: "
hours = gets.chomp.to_f
#calculate gross pay based on 40 hours
gross_pay = rate * 40
#calculate gross pay plus overtime
if(hours > 40 && hours <= 60)
gross_pay += (hours - 40) * (rate * 1.5)
puts "Gross pay: #{gross_pay}"
elsif(hours <= 40 )
puts "Gross pay: #{gross_pay}"
else
puts "Please see manager"
end