ruby-uebungen/Assignment_014/solution/readme.md

17 lines
200 B
Markdown
Raw Permalink Normal View History

2023-05-25 17:47:19 +02:00
# Lösung: Modul schreiben
2023-05-23 09:19:31 +02:00
2023-05-25 17:49:42 +02:00
```ruby
2023-05-25 17:47:19 +02:00
module Chemie
N_a = 6.02214179E23
M_v = 22.413996
2023-05-23 09:19:31 +02:00
2023-05-25 17:47:19 +02:00
def Chemie.volume_o2(m_O)
m_O / 32 * M_v
2023-05-23 09:19:31 +02:00
end
end
2023-05-25 17:47:19 +02:00
puts Chemie::N_a
puts Chemie::volume_o2(10.0)
```