Untitled
Untitled
Untitled
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:background="@drawable/pantalla1"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="363dp"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="CAJERO AUTOMATICO"
android:textColor="#020202"
android:textSize="30dp"
android:textStyle="bold">
</TextView>
</LinearLayout>
<EditText
android:id="@+id/etRetirar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="25sp"
android:textStyle="bold"
android:textColor="#46539E"
android:gravity="center"
android:hint="Ingresa cantidad a retirar"
android:inputType="number">
</EditText>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<Button
android:id="@+id/btnRetirar"
android:layout_width="match_parent"
android:onClick="Retirar"
android:layout_weight="1"
android:background="@drawable/botones"
android:textAllCaps="false"
android:textSize="18dp"
android:text="Retirar"
android:layout_height="wrap_content">
</Button>
<Button
android:id="@+id/btnTransaccion"
android:layout_width="match_parent"
android:onClick="Transacciones"
android:layout_weight="1"
android:background="@drawable/botones"
android:textAllCaps="false"
android:textSize="15dp"
android:text="NVA.Transaccion"
android:layout_height="wrap_content">
</Button>
<Button
android:id="@+id/btnSalir"
android:layout_width="match_parent"
android:onClick="Salir"
android:layout_weight="1"
android:background="@drawable/botones"
android:textAllCaps="false"
android:textSize="18dp"
android:text="Salir"
android:layout_height="wrap_content">
</Button>
</LinearLayout>
<TextView
android:id="@+id/Billetes"
android:layout_width="match_parent"
android:layout_height="287dp"
android:gravity="center_horizontal"
android:text=""
android:textSize="25dp"
android:textStyle="bold"></TextView>
<TextView
android:id="@+id/Resultado"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="25dp"
android:textStyle="bold"
android:gravity="left"
android:text="">
</TextView>
<TextView
android:id="@+id/saldo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="25dp"
android:textStyle="bold"
android:gravity="left"
android:text="Saldo inicial: $30000">
</TextView>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Creado por Luis Roberto y Juan David del Grupo 6AVP"
android:textStyle="bold"
android:textSize="25dp"
android:background="#0191FF"
android:layout_margin="10dp"
android:gravity="center"/>
//Luis Roberto Lara Segura y Juan David lopez
</LinearLayout>
package com.example.prueba
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_main.*
}
if (retiro >= 20) {
var C20 = 0;
C20 = retiro / 20
retiro = retiro - (C20 * 20)
B20=C20*20
Billetes.append("\n Billetes de 20: $C20")
}
real =B1000+B500+B200+B100+B50+B20
restante = Saldo - real
Resultado.setText("\n Cantidad real retirada:$$real")
saldo.setText("\n Saldo: $$restante")
}else{
Toast.makeText(this, "Saldo insuficiente", Toast.LENGTH_LONG).show()
}
}else{
Toast.makeText(this, "No puedes retirar mas de 8000", Toast.LENGTH_LONG).show()
}
} catch (mensaje: NumberFormatException){
Toast.makeText(this, "Ingresa datos antes de empezar",
Toast.LENGTH_LONG).show()
}
}
fun Transacciones(view:View){
etRetirar.setText("")
Billetes.text=""
Saldo=Saldo-real
Resultado.setText("")
}
fun Salir(view:View){
System.exit(0)
}
}