-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApple.rb
More file actions
86 lines (64 loc) · 1.77 KB
/
Apple.rb
File metadata and controls
86 lines (64 loc) · 1.77 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#Apple Inventory Homework
#=====================================
#Shane,
#
#I have hit walls with this here is my work so far
#=====================================
# class Apple
#
# def initialize (iPhone, iPad, iMac)
# @iPhone = iPhone
# @iPad = iPad
# @iMac = iMac
#
# end
apple_products = {
"iPhones" => 333,
"iPads" => 444,
"iMacs" => 222
}
products = "iPhones,iPads, & iMacs"
phone = apple_products ["iPhones"]
pad = apple_products ["iPads"]
mac = apple_products ["iMacs"]
#=========================================================
puts ""
puts "The Apple Store"
puts ""
puts "Welcome To Apple Inventory!"
puts ""
puts "We have #{products}"
puts ""
puts "You can tell me which item you would like and i can tell you how many units we have avaliable."
puts ""
puts "Which items are you interrested in today? iPhone, iPad, or iMac?"
user = gets.chomp
#=========================================================
if user == "iPhone"
puts "We currently have #{phone} iPhones in stock"
end
if user == "iPad"
puts "We currently have #{pad} iPads in stock"
end
if user == "iMac"
puts "We currently have #{mac} iMacs in stock"
end
#=========================================================
puts ""
puts "You can also tell how many of an item that you would like to buy and you can even add items that you like to see us offer."
puts ""
puts "Go ahead try it."
puts ""
puts "Just tell me how many of items you would you like"
puts ""
user_buy = gets.chomp
#=========================================================
if user_buy >= "iPhone"
puts
end
if user_buy == "iPad"
puts "We currently have #{pad} iPads in stock"
end
if user_buy == "iMac"
puts "We currently have #{mac} iMacs in stock"
end