From 7991daef7f2fe0a14dedf030c3d9cab5904534ad Mon Sep 17 00:00:00 2001 From: gregoryrodriguez Date: Fri, 3 May 2024 01:43:55 -0400 Subject: [PATCH 1/4] Primer ejercicio de Programming-Skills-Level0 --- Banking System/index.html | 12 ++++ Banking System/index.js | 117 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 Banking System/index.html create mode 100644 Banking System/index.js diff --git a/Banking System/index.html b/Banking System/index.html new file mode 100644 index 00000000..b6d5ac39 --- /dev/null +++ b/Banking System/index.html @@ -0,0 +1,12 @@ + + + + + Online Banking System - Gregory Rodríguez + + + + + + + \ No newline at end of file diff --git a/Banking System/index.js b/Banking System/index.js new file mode 100644 index 00000000..21d6bae0 --- /dev/null +++ b/Banking System/index.js @@ -0,0 +1,117 @@ +/* + 1. Create an online banking system with the following features: + +* Users must be able to log in with a username and password. +* If the user enters the wrong credentials three times, the system must lock them out. +* The initial balance in the bank account is $2000. +* The system must allow users to deposit, withdraw, view, and transfer money. +* The system must display a menu for users to perform transactions. +*/ + +let int = 3; +let balance = 2000; + +function login(){ + //username = usuario + user = prompt('Por favor, ingresa tu username: '); + pass = prompt('Ingrese su contraseña') + + if(user == 'usuario' && pass === '1234'){ + menu() + }else if(user === "" || pass === ""){ + alert("No dejar campos vacios") + login() + }else{ + if(int > 0 ){ + alert('Usuario o Contraseña incorrecta. Quedan ' + int-- + " intentos") + login() + }else{ + alert("SU CUENTA HA SIDO BLOOQUEDA") + } + } +} + +function menu(){ + let options = prompt('Elije el numero correspondiente a la operacion que deseas realizar:\n 1.- Deposito\n 2. Retiro\n 3. Consulta\n 4. Transferencia\n 5. Salir del sistema') + + if(options === "1"){ + deposit() + }else if(options === "2"){ + withdraw() + }else if(options === "3"){ + view(); + }else if(options === "4"){ + transfer(); + }else{ + alert("GRACIAS POR SU PREFERENCIA. VUELVA PRONTO") + } +} + + +function deposit(){ + let amount = prompt("Por favor ingrese el monto a depositar: ") + balance += Number(amount); + + let Dconfirm = confirm("Usted ha depositado: $" + amount + "\nSu saldo es: $" + balance + "\n\nDesea realizar otra operacion?") + if(Dconfirm === true){ + menu(); + }else{ + alert("GRACIAS POR SU PREFERENCIA. VUELVA PRONTO") + } +} + +function withdraw(){ + let withdrawamount = prompt("Ingrese monto a retirar:") + Number(withdrawamount); + + if(withdrawamount > balance ){ + let Wconfirm = confirm("Disculpe FONDOS INSUFICIENTES\nDesea realizar otra operacion?") + if(Wconfirm === true){ + menu(); + }else{ + alert("GRACIAS POR SU PREFERENCIA. VUELVA PRONTO") + } + }else if(withdrawamount <= balance){ + balance -= withdrawamount + let Wconfirm = confirm("Usted ha retirado: $" + withdrawamount + "\nSu balance es: $" + balance + "\n\n Desea realizar otra operacion?") + if(Wconfirm === true){ + menu(); + }else{ + alert("GRACIAS POR SU PREFERENCIA. VUELVA PRONTO") + } + } + +} + +function transfer(){ + let transferamount = prompt("Ingresar el monto a transferir:") + Number(transferamount); + + if(transferamount > balance){ + let Tconfirm = confirm("DISCULPE FONDOS INSUFICIENTES\nDesea realizar otra operacion?"); + if(Tconfirm === true){ + menu(); + }else{ + alert("GRACIAS POR SU PREFERENCIA. VUELVA PRONTO") + } + }else if(transferamount <= balance){ + balance -= transferamount; + let Tconfirm = confirm("Usted ha transferido: $" + transferamount + "\nSu balance es: $" + balance + "\n\n Desea realizar otra operacion?") + if(Tconfirm === true){ + menu(); + }else{ + alert("GRACIAS POR SU PREFERENCIA. VUELVA PRONTO") + } + } +} + +function view(){ + let Vconfirm = confirm("Su balance es: $" + balance+ "\n\n Desea realizar otra operacion?"); + if(Vconfirm === true){ + menu(); + }else{ + alert("GRACIAS POR SU PREFERENCIA. VUELVA PRONTO") + } +} + +login() From bda61e87d02f5f6a60187001a3b984d49ff1566b Mon Sep 17 00:00:00 2001 From: gregoryrodriguez Date: Fri, 3 May 2024 02:07:03 -0400 Subject: [PATCH 2/4] se agregaron variables username y password. Se mejoro el conteo de intentos fallidos --- Banking System/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Banking System/index.js b/Banking System/index.js index 21d6bae0..9df0a96c 100644 --- a/Banking System/index.js +++ b/Banking System/index.js @@ -7,7 +7,8 @@ * The system must allow users to deposit, withdraw, view, and transfer money. * The system must display a menu for users to perform transactions. */ - +let username = 'usuario'; +let password = '1234' let int = 3; let balance = 2000; From c4db3776f3b8fd297eee7152f64d1d5865a90159 Mon Sep 17 00:00:00 2001 From: gregoryrodriguez Date: Fri, 3 May 2024 02:09:36 -0400 Subject: [PATCH 3/4] se usan las variables username y password --- Banking System/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Banking System/index.js b/Banking System/index.js index 9df0a96c..02d8c24d 100644 --- a/Banking System/index.js +++ b/Banking System/index.js @@ -17,15 +17,19 @@ function login(){ user = prompt('Por favor, ingresa tu username: '); pass = prompt('Ingrese su contraseña') - if(user == 'usuario' && pass === '1234'){ + if(user == username && pass === password){ menu() }else if(user === "" || pass === ""){ alert("No dejar campos vacios") login() }else{ - if(int > 0 ){ + if(int > 1 ){ alert('Usuario o Contraseña incorrecta. Quedan ' + int-- + " intentos") login() + }else if(int === 1){ + alert('Usuario o Contraseña incorrecta. Ultimo intento') + int--; + login() }else{ alert("SU CUENTA HA SIDO BLOOQUEDA") } From e2402e2aa4ac8bac9ee5637e2b18ab382afd8ce4 Mon Sep 17 00:00:00 2001 From: gregoryrodriguez Date: Fri, 3 May 2024 22:41:50 -0400 Subject: [PATCH 4/4] Ejercicio Currency Converter --- Currency Converter/index.html | 12 + Currency Converter/index.js | 416 ++++++++++++++++++++++++++++++++++ 2 files changed, 428 insertions(+) create mode 100644 Currency Converter/index.html create mode 100644 Currency Converter/index.js diff --git a/Currency Converter/index.html b/Currency Converter/index.html new file mode 100644 index 00000000..5b31e4fe --- /dev/null +++ b/Currency Converter/index.html @@ -0,0 +1,12 @@ + + + + + + Currency Converter - Gregory Rodriguez + + + + + + \ No newline at end of file diff --git a/Currency Converter/index.js b/Currency Converter/index.js new file mode 100644 index 00000000..a63a575a --- /dev/null +++ b/Currency Converter/index.js @@ -0,0 +1,416 @@ + + // Create a currency converter between CLP, ARS, USD, EUR, TRY, GBP with the following features: + // The user must choose their initial currency and the currency they want to exchange to. + // The user can choose whether or not to withdraw their funds. If they choose not to withdraw, it should return to the main menu. + // If the user decides to withdraw the funds, the system will charge a 1% commission. + // Set a minimum and maximum amount for each currency, it can be of your choice. + // The system should ask the user if they want to perform another operation. If they choose to do so, it should restart the process; otherwise, the system should close. + + + let initialAmount = ''; + +function inicio(){ + let initialCurrency = prompt('Bienvenidos a la casa de cambio.\nConvertir de:\n1. Pesos Chilenos - CLP: $\n2. Pesos Argentinos - ARS: $\n3. Dolares EstadoUnidenses - USD: $\n4. Euros - EUR: €\n5. Lira Turca - TRY: ₺\n6. Libra Esterlina - GBP: £'); + + if(initialCurrency === ''){ + let continuar = confirm('CAMPO OBLIGATORIO.\n\nDesea continuar?'); + if(continuar === true){ + initialCurrency = prompt('Bienvenidos a la casa de cambio.\nConvertir de:\n1. Pesos Chilenos - CLP: $\n2. Pesos Argentinos - ARS: $\n3. Dolares EstadoUnidenses - USD: $\n4. Euros - EUR: €\n5. Lira Turca - TRY: ₺\n6. Libra Esterlina - GBP: £') + }else{ + alert('GRACIAS POR SU PREFERENCIA. VUELA PRONTO') + } + }else if(initialCurrency === '1'){ + initialAmount= prompt('Ingrese cantidad') + let finalCurrency = prompt('Convertir a:\n1. Pesos Chilenos - CLP: $\n2. Pesos Argentinos - ARS: $\n3. Dolares EstadoUnidenses - USD: $\n4. Euros - EUR: €\n5. Lira Turca - TRY: ₺\n6. Libra Esterlina - GBP: £') + clp(initialAmount, finalCurrency); + }else if(initialCurrency === '2'){ + initialAmount= prompt('Ingrese cantidad') + let finalCurrency = prompt('Convertir a:\n1. Pesos Chilenos - CLP: $\n2. Pesos Argentinos - ARS: $\n3. Dolares EstadoUnidenses - USD: $\n4. Euros - EUR: €\n5. Lira Turca - TRY: ₺\n6. Libra Esterlina - GBP: £') + ars(initialAmount, finalCurrency); + }else if(initialCurrency === '3'){ + initialAmount= prompt('Ingrese cantidad') + let finalCurrency = prompt('Convertir a:\n1. Pesos Chilenos - CLP: $\n2. Pesos Argentinos - ARS: $\n3. Dolares EstadoUnidenses - USD: $\n4. Euros - EUR: €\n5. Lira Turca - TRY: ₺\n6. Libra Esterlina - GBP: £') + usd(initialAmount, finalCurrency); + }else if(initialCurrency === '4'){ + initialAmount= prompt('Ingrese cantidad') + let finalCurrency = prompt('Convertir a:\n1. Pesos Chilenos - CLP: $\n2. Pesos Argentinos - ARS: $\n3. Dolares EstadoUnidenses - USD: $\n4. Euros - EUR: €\n5. Lira Turca - TRY: ₺\n6. Libra Esterlina - GBP: £') + eur(initialAmount, finalCurrency); + }else if(initialCurrency === '5'){ + initialAmount= prompt('Ingrese cantidad') + let finalCurrency = prompt('Convertir a:\n1. Pesos Chilenos - CLP: $\n2. Pesos Argentinos - ARS: $\n3. Dolares EstadoUnidenses - USD: $\n4. Euros - EUR: €\n5. Lira Turca - TRY: ₺\n6. Libra Esterlina - GBP: £') + trycurrency(initialAmount, finalCurrency); + }else if(initialCurrency === '6'){ + initialAmount= prompt('Ingrese cantidad') + let finalCurrency = prompt('Convertir a:\n1. Pesos Chilenos - CLP: $\n2. Pesos Argentinos - ARS: $\n3. Dolares EstadoUnidenses - USD: $\n4. Euros - EUR: €\n5. Lira Turca - TRY: ₺\n6. Libra Esterlina - GBP: £') + gbp(initialAmount, finalCurrency); + }else { + let pregunta = confirm('Desea salir del sistema?') + + if(pregunta === true){ + alert('GRACIAS POR SU PREFERENCIA. VUELA PRONTO') + } + inicio() + } +} + +function clp(amount, currency){ + if(currency === '1'){ + let symbol = '$'; + let cantidad = confirm('Pesos Chilenos - CLP: '+ symbol + Number(amount) / 1 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) / 1; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '2'){ + let symbol = '$'; + let cantidad = confirm('Pesos Argentinos - ARS: '+ symbol + Number(amount) * 0.94 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 0.94; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '3'){ + let symbol = '$'; + let cantidad = confirm('Dolares EstadoUnidenses - USD: '+ symbol + Number(amount) * 0.0011 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 0.0011; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '4'){ + let symbol = '€'; + let cantidad = confirm('Euros - EUR: '+ symbol + Number(amount) * 0.00099 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 0.00099; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '5'){ + let symbol = '₺'; + let cantidad = confirm('Lira Turca - TRY: '+ symbol + Number(amount) * 0.035 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 0.035; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '6'){ + let symbol = '£'; + let cantidad = confirm('Libra Esterlina - GBP: '+ symbol + Number(amount) * 0.00085 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 0.00085; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + } +} + +function ars(amount, currency){ + if(currency === '1'){ + let symbol = '$'; + let cantidad = confirm('Pesos Chilenos - CLP: '+ symbol + Number(amount) * 1.07 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 1.07; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '2'){ + let symbol = '$'; + let cantidad = confirm('Pesos Argentinos - ARS: '+ symbol + Number(amount) / 1 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) / 1; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '3'){ + let symbol = '$'; + let cantidad = confirm('Dolares EstadoUnidenses - USD: '+ symbol + Number(amount) * 0.0011 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 0.0011; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '4'){ + let symbol = '€'; + let cantidad = confirm('Euros - EUR: '+ symbol + Number(amount) * 0.0011 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 0.0011; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '5'){ + let symbol = '₺'; + let cantidad = confirm('Lira Turca - TRY: '+ symbol + Number(amount) * 0.037 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 0.037; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '6'){ + let symbol = '£'; + let cantidad = confirm('Libra Esterlina - GBP: '+ symbol + Number(amount) * 0.00090 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 0.00090; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + } +} + +function usd(amount, currency){ + if(currency === '1'){ + let symbol = '$'; + let cantidad = confirm('Pesos Chilenos - CLP: '+ symbol + Number(amount) * 938.92 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 938.92; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '2'){ + let symbol = '$'; + let cantidad = confirm('Pesos Argentinos - ARS: '+ symbol + Number(amount) * 878.75 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 878.75; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '3'){ + let symbol = '$'; + let cantidad = confirm('Dolares EstadoUnidenses - USD: '+ symbol + Number(amount) / 1 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) / 1; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '4'){ + let symbol = '€'; + let cantidad = confirm('Euros - EUR: '+ symbol + Number(amount) * 0.93 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 0.93; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '5'){ + let symbol = '₺'; + let cantidad = confirm('Lira Turca - TRY: '+ symbol + Number(amount) * 32.35 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 32.35; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '6'){ + let symbol = '£'; + let cantidad = confirm('Libra Esterlina - GBP: '+ symbol + Number(amount) * 0.7942 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 0.7942; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + } +} + +function eur(amount, currency){ + if(currency === '1'){ + let symbol = '$'; + let cantidad = confirm('Pesos Chilenos - CLP: '+ symbol + Number(amount) * 1012.72 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 1012.72; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '2'){ + let symbol = '$'; + let cantidad = confirm('Pesos Argentinos - ARS: '+ symbol + Number(amount) * 946.71 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 946.71; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '3'){ + let symbol = '$'; + let cantidad = confirm('Dolares EstadoUnidenses - USD: '+ symbol + Number(amount) * 1.08 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 1.08; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '4'){ + let symbol = '€'; + let cantidad = confirm('Euros - EUR: '+ symbol + Number(amount) / 1 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) / 1; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '5'){ + let symbol = '₺'; + let cantidad = confirm('Lira Turca - TRY: '+ symbol + Number(amount) * 34.85 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 34.85; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '6'){ + let symbol = '£'; + let cantidad = confirm('Libra Esterlina - GBP: '+ symbol + Number(amount) * 0.86 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 0.86; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + } +} + +function trycurrency(amount, currency){ + if(currency === '1'){ + let symbol = '$'; + let cantidad = confirm('Pesos Chilenos - CLP: '+ symbol + Number(amount) * 29.05 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 29.05; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '2'){ + let symbol = '$'; + let cantidad = confirm('Pesos Argentinos - ARS: '+ symbol + Number(amount) * 27.17 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 27.17; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '3'){ + let symbol = '$'; + let cantidad = confirm('Dolares EstadoUnidenses - USD: '+ symbol + Number(amount) * 0.031 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 0.031; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '4'){ + let symbol = '€'; + let cantidad = confirm('Euros - EUR: '+ symbol + Number(amount) * 0.029 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 0.029; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '5'){ + let symbol = '₺'; + let cantidad = confirm('Lira Turca - TRY: '+ symbol + Number(amount) / 1 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) / 1; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '6'){ + let symbol = '£'; + let cantidad = confirm('Libra Esterlina - GBP: '+ symbol + Number(amount) * 0.025 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 0.025; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + } +} + +function gbp(amount, currency){ + if(currency === '1'){ + let symbol = '$'; + let cantidad = confirm('Pesos Chilenos - CLP: '+ symbol + Number(amount) * 1183.15 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 1183.15; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '2'){ + let symbol = '$'; + let cantidad = confirm('Pesos Argentinos - ARS: '+ symbol + Number(amount) * 1105.27 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 1105.27; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '3'){ + let symbol = '$'; + let cantidad = confirm('Dolares EstadoUnidenses - USD: '+ symbol + Number(amount) * 1.26 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 1.26; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '4'){ + let symbol = '€'; + let cantidad = confirm('Euros - EUR: '+ symbol + Number(amount) * 1.17 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) * 1.17; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '5'){ + let symbol = '₺'; + let cantidad = confirm('Lira Turca - TRY: '+ symbol + Number(amount) + 40.66 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) + 40.66; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + }else if(currency === '6'){ + let symbol = '£'; + let cantidad = confirm('Libra Esterlina - GBP: '+ symbol + Number(amount) / 1 + "\nDesea retirar esta cantidad? ") + let cantidadExchange = Number(amount) / 1; + if(cantidad === true){ + withdraw(cantidadExchange, symbol); + }else{ + inicio(); + } + } +} + +function withdraw(cantidad, symbol){ + Number(cantidad) + let comision = cantidad * 0.01; + let retiro = confirm('DATOS DE RETIRO\nCantidad: '+ symbol + cantidad + '\nComision 1%: ' + symbol + comision + '\nTotal a Retirar: ' + symbol+ (cantidad - comision) + '\n\nDesea realizar una nueva operacion?') + + if(retiro === true){ + inicio() + }else{ + alert('GRACIAS POR SU PREFERENCIA. VUELA PRONTO') + } +} + +inicio() \ No newline at end of file