electriccitybillpredictor 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/electiccitypredictor.rb +56 -0
  2. metadata +47 -0
@@ -0,0 +1,56 @@
1
+ module Electiccitypredictor
2
+
3
+ def yearlyconsumption_onrooms(matter)
4
+ consumption = matter
5
+ puts "Enter the number of rooms : "
6
+ a=gets.chomp.to_i
7
+ b = consumption*a
8
+
9
+ puts "Yearly consumption of a #{a} BHK rooms in terms of power consumption is #{b} KWH"
10
+ end
11
+
12
+ def monthlyconsumption(matter,cost)
13
+ consumption = matter
14
+ cost = cost
15
+ puts "Enter the number of rooms : "
16
+ a = gets.chomp.to_i
17
+ b = (consumption*a)/12
18
+ c = b*cost
19
+ puts "Monthly consumption of a #{a} BHK rooms in terms of power consumption is #{b} KWH and the cost is #{c}"
20
+ end
21
+ def consumption(appliances,cost)
22
+ appconsumed = appliances
23
+ cost = cost
24
+ sum = 0
25
+
26
+ appconsumed.each do |key,value|
27
+ if (key == "Washing_machiene")
28
+ washing = value * 600
29
+ sum = washing+sum
30
+ end
31
+ if (key == "Light")
32
+ light = value * 100
33
+ sum = light+sum
34
+ end
35
+ if (key == "Cooker")
36
+ cooker = value * 660
37
+ sum = cooker+sum
38
+ end
39
+ if (key == "Computer")
40
+ computer = value * 166
41
+ sum = computer+sum
42
+ end
43
+
44
+ end
45
+ puts "THE SUM OUTSTIDE IS #{sum}"
46
+
47
+ sum = sum/1000
48
+ puts "THE SUM OUTSTIDE IS #{sum}"
49
+ amount = sum * cost
50
+ puts "Complete consumption per day for you is #{sum} KWH and its cost is #{amount}"
51
+ month = sum * 30
52
+ value = cost * month
53
+ puts "Complete consumption per month for you is #{month} KWH and its cost is #{value} "
54
+ return value
55
+ end
56
+ end
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: electriccitybillpredictor
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Manoj Kannan
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2019-03-01 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: ! 'returns true if the given number is even,
15
+
16
+ otherwise returns false.'
17
+ email: manojitkannan@gmail.com
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - lib/electiccitypredictor.rb
23
+ homepage: http://rubygems.org/gems/electriccitybillpredictor
24
+ licenses: []
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubyforge_project:
43
+ rubygems_version: 1.8.23
44
+ signing_key:
45
+ specification_version: 3
46
+ summary: Predicts electricity bill.
47
+ test_files: []