1. package javaapplication1;
import java.util.*;
public class JavaApplication1 {
public static void main(String[] args) {
double tamaño=0,acu=0;
int tipo,a;
Scanner sc = new Scanner(System.in);
System.out.print("Ingresar la cantidad de dinero incial : ");
tamaño=sc.nextDouble();
System.out.print("QUE OPERACION DESEA REALIZAR -->1:depositar ,
--->2:retirar ; --->3:mostrar estado de cuenta : ");
tipo =sc.nextInt();
System.out.print("DESEA CONTINUAR --->1:SI , ---->0:NO : ");
a =sc.nextInt();
do{
System.out.print("QUE OPERACION DESEA REALIZAR -->1:depositar ,
--->2:retirar ; --->3:mostrar estado de cuenta : ");
tipo =sc.nextInt();
tamaño=tamaño+acu;
if(tipo == 1){depositar ( tamaño);
}
if(tipo == 2){retirar( tamaño );
}
if(tipo == 3){mostrar( acu );
;}
}
while(a==1);
}
public static void mostrar(double tamaño){
System.out.print("Saldo actual en su cuenta : "+tamaño);
System.out.println("");
}
public static double depositar(double depo ){
double tamañoarchivo;
Scanner sc =new Scanner(System.in);
System.out.print("Ingresar la cantidad que usted desea depositar : ");
tamañoarchivo=sc.nextDouble();
tamañoarchivo=depo+tamañoarchivo;
System.out.print("ustedet tienen en su cuenta : "+tamañoarchivo);
return tamañoarchivo;
}
public static double retirar(double depo ){
double tamañoarchivo;
Scanner sc =new Scanner(System.in);
System.out.print("Ingresar la cantidad que usted desea retirar : ");
tamañoarchivo=sc.nextDouble();
tamañoarchivo=depo-tamañoarchivo;
System.out.print("ustedet tienen en su cuenta : "+tamañoarchivo);
return tamañoarchivo;
}
}