rsrquestions 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/rsrquestions.rb +117 -0
  3. metadata +43 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7c9839c7ec9b1b598f252d592943aedc6f62e70c
4
+ data.tar.gz: be1e09fbff2c8f4a565809527d13c21a3e418c7e
5
+ SHA512:
6
+ metadata.gz: a1a8716b167c800cfc5942d2252fd86a7aea7788f42f8985d8a6b6cf7ca25cab9d3bfd0e60347baba2aa96cc143f29f840157a3070e9b3cd1b1d86ce79762510
7
+ data.tar.gz: 8966f10949b75980df578f73181570c779bebab4e34f245a11a12667549686f4d43e5b615ba0efad2ef3ccbae82b3f541d5f1f33ddc58c6c6a78454a2931e4fd
@@ -0,0 +1,117 @@
1
+ class Questions
2
+
3
+ def self.creatingquestion()
4
+
5
+ #Standard Arithmetic Operation(Addition , Subtraction, Multiplication and Division)
6
+ one = rand(1...100)
7
+
8
+ two = rand(1...100)
9
+
10
+ three = rand(1...100)
11
+
12
+ quiz1 = "What is #{one.to_s} + #{two.to_s} + #{three.to_s}?"
13
+
14
+ puts quiz1
15
+ answerone = one + two + three
16
+
17
+
18
+ four = rand(100...200)
19
+ five = rand(100...150)
20
+ six = rand(10...50)
21
+ quiz2 = "What is #{four.to_s} - #{five.to_s} - #{six.to_s}?"
22
+ puts quiz2
23
+ answertwo = four - five - six
24
+
25
+
26
+ seven = rand(100...500)
27
+
28
+ eight = rand(100...1000)
29
+
30
+ quiz3 = "What is #{seven.to_s} * #{eight.to_s}?"
31
+ puts quiz3
32
+
33
+ answerthree = seven * eight
34
+
35
+
36
+ nine = rand(50...500)
37
+ ten = rand(10...100)
38
+ quiz4 = "What is #{nine.to_s} / #{ten.to_s}?"
39
+ puts quiz4
40
+ answerfour = nine / ten
41
+
42
+
43
+
44
+ #Mixture of Operations
45
+
46
+
47
+
48
+ # addition and multiplication
49
+
50
+ eleven = rand(500...1000)
51
+ twelve = rand(100...500)
52
+ thirteen = rand(100...500)
53
+ quiz5 = "What is #{eleven.to_s} + #{twelve.to_s} * #{thirteen.to_s}?"
54
+ puts quiz5
55
+ answerfive = eleven + twelve * thirteen
56
+
57
+
58
+
59
+
60
+
61
+
62
+ # divide and minus
63
+
64
+ fourteen = rand(50...100)
65
+ fifteen = rand(10...50)
66
+ sixteen = rand(10...50)
67
+ quiz6 = "What is #{fourteen.to_s} / #{fifteen.to_s} - #{sixteen.to_s}?"
68
+ puts quiz6
69
+ answersix = fourteen / fifteen - sixteen
70
+
71
+
72
+
73
+ # multiply and addition
74
+
75
+ seventeen = rand(500...1000)
76
+ eighteen = rand(100...500)
77
+ nineteen = rand(100...500)
78
+ quiz7 = "What is #{seventeen.to_s} * #{eighteen.to_s} + #{nineteen.to_s}?"
79
+ puts quiz7
80
+ answerseven = seventeen * eighteen + nineteen
81
+
82
+ # multiply and addition and Subtract
83
+
84
+ twenty = rand(500...1000)
85
+ twentyone = rand(100...500)
86
+ twentytwo = rand(100...500)
87
+ quiz8 = "What is #{twenty.to_s} * #{twentyone.to_s} - #{twentytwo.to_s}?"
88
+ puts quiz8
89
+ answereight = twenty * twentyone - twentytwo
90
+
91
+ # multiply and addition and Subtract
92
+
93
+ twentyfour = rand(500...1000)
94
+ twentyfive = rand(100...500)
95
+ twentysix = rand(100...500)
96
+ twentyseven = rand(100...500)
97
+ twentyeight = rand(100...500)
98
+ quiz9 = "What is #{twentyfour.to_s} * #{twentyfive.to_s} * #{twentysix.to_s} + #{twentyseven.to_s} - #{twentyeight.to_s}?"
99
+ puts quiz9
100
+ answernine = twentyfour * twentyfive * twentysix + twentyseven - twentyeight
101
+
102
+
103
+ #multiply and divide
104
+ twentynine = rand(50...1000)
105
+ thirty = rand(10...500)
106
+ thirtyone = rand(10...50)
107
+ quiz10 = "What is #{twentynine.to_s} * #{thirty.to_s} / #{thirtyone.to_s}?"
108
+ puts quiz10
109
+ answerten = twentynine / thirty - thirtyone
110
+
111
+
112
+
113
+ return quiz1, answerone, quiz2, answertwo, quiz3, answerthree, quiz4, answerfour, quiz5, answerfive, quiz6, answersix, quiz7, answerseven, quiz8, answereight, quiz9, answernine, quiz10, answerten
114
+ end
115
+ end
116
+
117
+
metadata ADDED
@@ -0,0 +1,43 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rsrquestions
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - RSR
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-25 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: creats random maths questions
14
+ email: reynaldo.s.reyes.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/rsrquestions.rb
20
+ homepage: http://rubygems.org/gems/rsrquestions
21
+ licenses: []
22
+ metadata: {}
23
+ post_install_message:
24
+ rdoc_options: []
25
+ require_paths:
26
+ - lib
27
+ required_ruby_version: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: '0'
32
+ required_rubygems_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ requirements: []
38
+ rubyforge_project:
39
+ rubygems_version: 2.2.2
40
+ signing_key:
41
+ specification_version: 4
42
+ summary: A Simple Gem
43
+ test_files: []