-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfotocopiadora.exs
27 lines (27 loc) · 926 Bytes
/
fotocopiadora.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
defmodule fotocopiadora do
def main do
IO.puts("\e[H\e[2J")
#######################################
hojas =
IO.gets("ingresa la cantidad de hojas por favor")
|> String.trim()
|> String.to_integer()
#######################################
total = hojas * 20
########################################
total = if hojas > 30, do: total * 0.90, else: total
#########################################
IO.puts("presiona enter para continuar")
IO.gets("")
#########################################
IO.puts("\e[H\e[2J")
#########################################
IO.puts("*****Boleta****
cantidad de hojas #{hojas}
valor por hoja $20
TOTAL $#{total}")
end
end
##########################################
fotocopiadora.main()
##########################################