movie_theater_fp 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/movie_theater_fp.rb +35 -0
- metadata +45 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 726a04e5022b54ac58af891906bca4dc35a2371a
|
4
|
+
data.tar.gz: f66c1f2c92447fe0ef384e461d1737f6a467070d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c03f8d2c4a1ca16fff460cb67c5caddefa76d8f80fc00d3b9bec34c849219cdeab922f1657267abd5ac5e1da9ec823e3c3c20ad7223270f668e72ac0f930cde1
|
7
|
+
data.tar.gz: b66497af57202e2e98a86a568641d9bd19ae2d7fc9e29db5c52191cdb3001b2b4fdc01f854676e0cebf7022be53c9bf345a25939c08d18861546bd093c9c0b1b
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Write a program that asks for user age and if more than 18 let him watch the
|
2
|
+
# movie, else he can't
|
3
|
+
# idea for v2: present movies menu so the user must pick one, then see if pass
|
4
|
+
# minimum age rating
|
5
|
+
|
6
|
+
puts "Hello sir. May I help you?"
|
7
|
+
hello_question = gets.chomp
|
8
|
+
|
9
|
+
if hello_question.capitalize == 'Yes'
|
10
|
+
# ask for user name.
|
11
|
+
puts "Welcome to Cinemark. What's your name?"
|
12
|
+
name = gets.chomp
|
13
|
+
puts "Hello #{name.capitalize}! Each ticket is $16.99 but I need to confirm your
|
14
|
+
age before you can get tickets for \"Midnight Nightmare 5\"."
|
15
|
+
puts "How old are you?"
|
16
|
+
age = gets.to_i
|
17
|
+
|
18
|
+
if age >= 18
|
19
|
+
# sell tickets
|
20
|
+
puts "That's great #{name.capitalize}! How many tickets would you like?"
|
21
|
+
ticket_quantity = gets.to_i
|
22
|
+
puts "#{name.capitalize}, the total amount for #{ticket_quantity} will be
|
23
|
+
#{ticket_quantity * 16.99}."
|
24
|
+
puts "Here they are! Have a great movie. Bye"
|
25
|
+
|
26
|
+
else
|
27
|
+
# can't buy tickets
|
28
|
+
puts "Sorry, you cannot buy tickets for \"Midnight Nightmare 5\". Goodbye!"
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
else
|
33
|
+
# say good bye.
|
34
|
+
puts "Goodbye!"
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: movie_theater_fp
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Fellipe de Paula
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-02-18 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: The library opens up the String class and adds a method writesize, which
|
14
|
+
returns the size of the string.
|
15
|
+
email:
|
16
|
+
- fellipedepaula@gmail.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- lib/movie_theater_fp.rb
|
22
|
+
homepage: ''
|
23
|
+
licenses: []
|
24
|
+
metadata: {}
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
requirements: []
|
40
|
+
rubyforge_project:
|
41
|
+
rubygems_version: 2.2.2
|
42
|
+
signing_key:
|
43
|
+
specification_version: 4
|
44
|
+
summary: String Extend
|
45
|
+
test_files: []
|