Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Programa Interactivo Haskell
- opcion1 = "1.Introducir un producto"
- opcion2 = "2.Estadísticas"
- opcion3 = "3.Salir"
- introducir1 = "Introduzca un nombre:"
- introducir2 = "Introduzca un precio:"
- opciones = do
- putStrLn opcion1
- putStrLn opcion2
- putStrLn opcion3
- introducirProducto = do
- putStrLn introducir1
- nombreProducto <- getLine
- putStrLn introducir2
- precioProducto <- getLine
- main
- main = do
- putStrLn "Introduzca una opcion:"
- opciones
- name <- getLine
- if name == ['1']
- then introducirProducto
- else
- if name == ['3']
- then return ()
- else (do
- putStrLn $ ("Hey " ++ name ++ ", you rock!");
- main)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement