client-calcule 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,31 @@
1
+ require_relative 'client-calcule/calcul'
2
+ class Client
3
+
4
+ def self.meniu()
5
+ k = false
6
+ while not k
7
+ puts <<MENIU
8
+ Alege optiunile:
9
+
10
+ 1. Calcul proratare.
11
+ 2. Calcul TVA
12
+ 3. Calcul abonament
13
+ 0. Exit
14
+ MENIU
15
+ print "Alegeti optiunea:"
16
+ a = STDIN.gets.to_i
17
+ if a == 1
18
+ Calcul.proratare()
19
+ elsif a == 2
20
+ Calcul.tva()
21
+ elsif a == 3
22
+ Calcul.abo()
23
+ elsif a == 0
24
+ k = true
25
+ else
26
+ puts "Optiune indisponibila!"
27
+ end
28
+ end
29
+ end
30
+ end
31
+
@@ -0,0 +1,36 @@
1
+ module Calcul
2
+
3
+ def Calcul.proratare()
4
+
5
+ print "Dati data in care si-a facut clientul abonamentul:"
6
+ a = STDIN.gets.to_i
7
+ print "Dati valoarea abonamentului:"
8
+ b = STDIN.gets.to_i
9
+ c = (b/30.0)*(30-a)
10
+ puts "Clientul mai are de platit #{c} lei"
11
+
12
+ end
13
+
14
+ def Calcul.tva()
15
+
16
+ print "Introduceti suma pt care vreti sa calculati TVA-ul"
17
+ a = STDIN.gets.to_i
18
+ tv = a*1.24
19
+ b = tv - a
20
+ puts "#{a}+TVA = #{tv}"
21
+ puts "TVA-ul din #{a} este #{b}"
22
+
23
+ end
24
+
25
+ def Calcul.abo()
26
+
27
+ print "Introduceti valoarea abonamentului:"
28
+ a = STDIN.gets.to_i
29
+ print "Introduceti durata contractului in luni:"
30
+ b = STDIN.gets.to_i
31
+ c = b*a
32
+ puts "Valoarea totala a abonamentului este : #{c}"
33
+
34
+ end
35
+ end
36
+
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: client-calcule
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Ionut Pavlencu
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-02-08 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Program pentru calcularea diverselor sume pt contabilitate.
15
+ email: ionut.pavlencu@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/client-calcule.rb
21
+ - lib/client-calcule/calcul.rb
22
+ homepage: http://rubygems.org/gems/client
23
+ licenses:
24
+ - MIT
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: Verificare calcule uzuale.
47
+ test_files: []