ElectricCityPredictor 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/ElectricCityPredictor.rb +60 -0
 - metadata +47 -0
 
| 
         @@ -0,0 +1,60 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module ElectricCityPredictor
         
     | 
| 
      
 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 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                    return b,c 
         
     | 
| 
      
 22 
     | 
    
         
            +
             end
         
     | 
| 
      
 23 
     | 
    
         
            +
            def consumption(appliances,cost)
         
     | 
| 
      
 24 
     | 
    
         
            +
                 appconsumed = appliances
         
     | 
| 
      
 25 
     | 
    
         
            +
                 cost = cost
         
     | 
| 
      
 26 
     | 
    
         
            +
                 sum = 0
         
     | 
| 
      
 27 
     | 
    
         
            +
                 
         
     | 
| 
      
 28 
     | 
    
         
            +
                      appconsumed.each do |key,value|
         
     | 
| 
      
 29 
     | 
    
         
            +
                            if (key == "Washing_machiene")
         
     | 
| 
      
 30 
     | 
    
         
            +
                                 washing = value * 600
         
     | 
| 
      
 31 
     | 
    
         
            +
                             sum = washing+sum
         
     | 
| 
      
 32 
     | 
    
         
            +
                            end
         
     | 
| 
      
 33 
     | 
    
         
            +
                            if (key == "Light")
         
     | 
| 
      
 34 
     | 
    
         
            +
                                light = value * 100
         
     | 
| 
      
 35 
     | 
    
         
            +
                                sum = light+sum
         
     | 
| 
      
 36 
     | 
    
         
            +
                            end
         
     | 
| 
      
 37 
     | 
    
         
            +
                            if (key == "Cooker")
         
     | 
| 
      
 38 
     | 
    
         
            +
                                 cooker = value * 660
         
     | 
| 
      
 39 
     | 
    
         
            +
                             sum = cooker+sum
         
     | 
| 
      
 40 
     | 
    
         
            +
                            end
         
     | 
| 
      
 41 
     | 
    
         
            +
                            if (key == "Computer")
         
     | 
| 
      
 42 
     | 
    
         
            +
                                computer = value * 166
         
     | 
| 
      
 43 
     | 
    
         
            +
                                sum = computer+sum
         
     | 
| 
      
 44 
     | 
    
         
            +
                            end
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
              end
         
     | 
| 
      
 47 
     | 
    
         
            +
                                puts "THE SUM OUTSTIDE IS #{sum}"
         
     | 
| 
      
 48 
     | 
    
         
            +
              
         
     | 
| 
      
 49 
     | 
    
         
            +
                            sum = sum/1000
         
     | 
| 
      
 50 
     | 
    
         
            +
                            puts "THE SUM OUTSTIDE IS #{sum}"
         
     | 
| 
      
 51 
     | 
    
         
            +
                            amount = sum * cost
         
     | 
| 
      
 52 
     | 
    
         
            +
                           puts "Complete consumption per day for you is #{sum} KWH and its cost is #{amount}"
         
     | 
| 
      
 53 
     | 
    
         
            +
                           month = sum * 30
         
     | 
| 
      
 54 
     | 
    
         
            +
                           value = cost * month
         
     | 
| 
      
 55 
     | 
    
         
            +
                           puts "Complete consumption per month for you is #{month} KWH and its cost is #{value} "
         
     | 
| 
      
 56 
     | 
    
         
            +
                           return value
         
     | 
| 
      
 57 
     | 
    
         
            +
            end
         
     | 
| 
      
 58 
     | 
    
         
            +
            end
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,47 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: ElectricCityPredictor
         
     | 
| 
      
 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-28 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/ElectricCityPredictor.rb
         
     | 
| 
      
 23 
     | 
    
         
            +
            homepage: http://rubygems.org/gems/isNumberEven
         
     | 
| 
      
 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: verifies if a given number is even.
         
     | 
| 
      
 47 
     | 
    
         
            +
            test_files: []
         
     |