You are on page 1of 1

main::IO()

main=do
putStrLn
putStrLn
putStrLn
putStrLn
putStrLn
putStrLn
putStrLn
putStrLn
putStrLn
putStrLn
putStrLn
putStrLn
putStrLn
putStrLn
putStrLn
putStrLn
putStrLn

"+----------------------------+";
"|
CALCULADORA DIGITAL
|";
"+--------+-------+-------+---+";
"| 7
|
8
|
"|--------+-------+-------+---|";
"| 4
|
5
|
"|--------+-------+-------+---|";
"| 1
|
2
|
"|--------+-------+-------+---|";
"|
0
|
"|--------+-------+-------+---|";
"";
"+-----------MENU-------------+";
"[1] SUMA";
"[2] RESTA";
"[3] MULTIPLICACION";
"[4] DIVISION";

operacion <- readLn;


if(operacion==1) then suma else print 0
if(operacion==2) then resta else print 0
if(operacion==3) then multi else print 0
suma:: IO()
suma=do{
putStrLn "Digite numero 1";
n1 <- readLn;
putStrLn "Digite numero 2";
n2 <- readLn;
print n1+n2;
;};
resta:: IO()
resta=do{
putStrLn "Digite numero 1";
n1 <- readLn;
putStrLn "Digite numero 2";
n2 <- readLn;
print n1+n2;
};
multi:: IO()
multi=do{
putStrLn "Digite numero 1";
n1 <- readLn;
putStrLn "Digite numero 2";
n2 <- readLn;
print n1+n2;
};

| +

|";

| -

|";

| X

|";

| /

|";

You might also like